C#------LINQ查询(一)
1.C# 中数字常见操作及其取值范围2.C# 泛型列表类型管理数据集合3.C# 通过Queue类来实现队列的先进先出4.C# 非泛型集合的简单迭代5.C# 语言集成查询LINQ6.委托简单实现7..net 和.net framework区别8.C#-随笔杂记9.wpf-TextBlock文本内容自动换行10.C# 非引用类型初始化为空11.C#------------await12.C#------新特性之??、?、??= 使用
13.C#------LINQ查询(一)
14.C#——LINQ to XML(创建 XML 树)15.C#——LINQ to XML(内容快速查找)16.C#——LINQ to XML(使用 Descendants 方法查找单个子代)17.C#——fixed用法18.C#——匿名类型19.C#——属性init访问器方法20.C#——自动实现的属性21.C#——对象初始值设定项22.Assembly.CreateInstance 方法和Activator.CreateInstance 方法(C#)23.DragDrop.DoDragDrop(DependencyObject, Object, DragDropEffects) 方法——控件拖动方法24.通讯过程中16进制字符和byte[]/十进制和16进制转换(一)25.C# Modbus Tcp 实现(二)26.C# Modbus Tcp实现(一)27.C# 进制变换过程中左侧填充0实现28.DLR(动态语言运行时)(一)29.wpf textbox中UpdateSourceTrigger=PropertyChanged1.查询一定范围数字
static void QueryInt() { // Specify the data source. int[] scores = { 97, 92, 81, 60 }; // Define the query expression. IEnumerable<int> scoreQuery = from score in scores where score > 90 select score; // Execute the query. foreach (int i in scoreQuery) { Console.Write(i + " "); } // Output: 97 92 }
2.查询包含指定字符的字符
static void QueryString() { // Specify the data source. string[] scores = { "SU001", "SU003", "EFUN", "ECHO" }; // Define the query expression. IEnumerable<string> scoreQuery = from score in scores where score.StartsWith("SU") select score; // Execute the query. foreach (string i in scoreQuery) { Console.Write(i + " "); } // Output: SU001 SU003 }
3.查询指定条件对象
public class StudentScore { public string StudentName { get; set; } public int MathScore { get; set; } public int EnglishScore { get; set; } public int ChineseScore { get; set; } }
static void Main(string[] args) { //QueryInt(); //QueryString(); List<StudentScore> students = new List<StudentScore> { new StudentScore(){StudentName="SU001",MathScore=95,EnglishScore = 100,ChineseScore = 99}, new StudentScore(){StudentName="SU003",MathScore=100,EnglishScore=100,ChineseScore=88}, new StudentScore(){StudentName="S0004",MathScore=80,EnglishScore=80,ChineseScore=90} }; //查询所有SU学生 IEnumerable<StudentScore> studentQuery = from student in students where student.StudentName.StartsWith("SU") select student; //打印学生 foreach (StudentScore s in studentQuery) { Console.WriteLine(s.StudentName); } }
------------------------------------
承接
**视觉检测软件开发及调试
**工业软件开发
**上位机软件开发
wechat:luoran2024
qq:565934058
email:taoyuansu@qq.com
海量教育资源及影视资源下载
微信公众号:EFun科技
------------------------------------
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!