-
C# 泛型列表List用法示例
C# 泛型列表List用法示例,从给出的人员名单中,过滤人员名称中以"科"结束的序列,遍历查询结果。
private void Frm_Main_Load(object sender, EventArgs e)
{
List People = new List{//创建人员列表
new Person(1,"王*科"),
new Person(2,"王*科"),
new Person(3,"赵*东")};
var query = from p in People//过滤人员名称中以"科"结束的序列
where p.Name.EndsWith("科")
select new
{
人员ID = p.ID,
人员姓名 = p.Name
};
foreach (var item in query)//遍历查询结果
{
label1.Text += item + "
";
}
}
}
public class Person
{
public Person(int id, string name)
{
this.ID = id;
this.Name = name;
}
public int ID { get; set; }//人员ID
public string Name { get; set; }//人员姓名
}
- 2023-01-08 20:45:03下载
- 积分:1
-
vb create a default project, and to facilitate the establishment of a new projec...
vb默认工程创建器,方便建立新工程,并做好最基本的设置,使创建最基本的VB工程,快捷方便,很有实用性。-vb create a default project, and to facilitate the establishment of a new project and do a good job in the most basic settings, so that the VB project to create the most basic, fast and convenient, it is practical.
- 2022-02-26 00:50:27下载
- 积分:1
-
cm230
Conical Monopole Antenna
- 2017-11-17 10:44:27下载
- 积分:1
-
声波有限差分法正演模拟c语言程序
有限差分数值模拟地震记录,绘制正演模拟波前快照。(Seismic wave inverse time migration program can realize the inversion of seismic wave)
- 2020-07-22 21:28:45下载
- 积分:1
-
is a digital editor
是一个数码编辑
- 2022-06-03 15:14:25下载
- 积分:1
-
双端影视
免自动解析各大影视APP,无需再开通VIP去看电影!(Avoid automatic parsing of major movies and TV apps, no need to open VIP to see movies!)
- 2020-06-15 22:25:02下载
- 积分:1
-
multiple object tracking matlabcode(3D)
matlab实现数据追踪,有源码,结果图(MATLAB data tracking, source code, result diagram)
- 2018-06-07 16:01:59下载
- 积分:1
-
cpp_sec_ppt2
很好的学习C++的教程,这是第七章至第十二章的PPT(Good learning C++ s Guide, which is under Chapter VII to XII of the PPT)
- 2007-12-16 19:52:32下载
- 积分:1
-
STM8S控制的电动车无刷驱动
一款基于STM8单片机的电动车控制器,包含充电系统等模块(An electric vehicle controller based on STM8 microcontroller, including charging system and other modules)
- 2018-06-05 09:10:53下载
- 积分:1
-
0720_03_AD_uart
基于fpga的verilog实现ad及uart,并进行仿真验证(Verilog based on FPGA implements AD and uart, and carries out simulation verification)
- 2019-01-21 20:52:46下载
- 积分:1