资源简介
[北风网牛牛讲师8.21日LINQ入门到精通系列开始更新--Nhibernate系列专题讲座之NHibernate的五部曲(共4课时)].Demo.rar

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace ch01
{
public partial class Form1 : Form
{
//定义一个委托
public delegate string deleTransfer(string s);//注意方法签名
public Form1()
{
InitializeComponent();
}
private void btnTest_Click(object sender EventArgs e)
{
//LinQ体验
int[] arr = { 123123121545464856785};
////获取大于50的数
////没有LinQ我们怎么做?
//ArrayList result = new ArrayList();
//for (int i = 0; i < arr.Length; i++)
//{
// if (arr[i] > 50)
// {
// result.Add(arr[i]);
// }
//}
////打印result就OK了
//for (int i = 0; i < result.Count; i++)
//{
// Console.WriteLine(result[i]);
//}
//有了LinQ后我们可以这么做
//获取大于50的数
IEnumerable ie= arr.Select(p=>p).Where(p=>p>50);
//输出---该部分代码可重用
IEnumerator result= ie.GetEnumerator();
while (result.MoveNext())
{
Console.WriteLine(result.Current);
}
}
private void btnExtraMethod_Click(object sender EventArgs e)
{
//拓展方法----
string s = “asEdSadaDsdSsa“;
Console.WriteLine(s.ToUpper());
Console.WriteLine(s.ToLower());
Console.WriteLine(s.ToPascal());
Console.WriteLine(s.ToPascal(2));
}
private void btnLambda_Click(object sender EventArgs e)
{
//Lambda 来源
//.net frameWork 1.0 委托---函数指针
//deleTransfer trans = new deleTransfer(ToPascal);//委托指向方法ToPascal
//Console.WriteLine(trans(“abcdEFGH“));
//.net frameWork 2.0 匿名方法
//deleTransfer trans = delegate(string s) { return s.Substring(0 1).ToUpper() + s.Substring(1).ToLower(); };
//Console.WriteLine(trans(“abcdEFGH“));
//.net frameWork 3.5 Lambda
//deleTransfer trans=(s)=>(s.Substring(0 1).ToUpper() + s.Substring(1).ToLower());
deleTransfer trans = s =>s.Substring(0 1).ToUpper() + s.Substring(1).ToLower();
Console.WriteLine(trans(“abcdEFGH“));
}
//将字符串的首写字母转化为大写字母的方法
public string ToPascal(string s)
{
return s.Substring(0 1).ToUpper() + s.Substring(1).ToLower();
}
private void btnSelect_Click(object sender EventArgs e)
{
//LinQ To objects
//泛型集合数据persons
List persons = new List();
persons.Add(“zhang san“);
person
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 11776 2009-08-18 22:12 Demo\ch01\ch01\bin\Debug\ch01.exe
文件 30208 2009-08-18 22:12 Demo\ch01\ch01\bin\Debug\ch01.pdb
文件 14328 2009-08-18 22:12 Demo\ch01\ch01\bin\Debug\ch01.vshost.exe
文件 490 2007-07-21 01:33 Demo\ch01\ch01\bin\Debug\ch01.vshost.exe.manifest
文件 3719 2009-08-18 20:48 Demo\ch01\ch01\ch01.csproj
文件 5560 2009-08-18 22:13 Demo\ch01\ch01\Form1.cs
文件 4041 2009-08-18 21:45 Demo\ch01\ch01\Form1.Designer.cs
文件 5814 2009-08-18 21:45 Demo\ch01\ch01\Form1.resx
文件 631 2009-08-18 22:12 Demo\ch01\ch01\obj\Debug\ch01.csproj.FileListAbsolute.txt
文件 847 2009-08-18 22:00 Demo\ch01\ch01\obj\Debug\ch01.csproj.GenerateResource.Cache
文件 11776 2009-08-18 22:12 Demo\ch01\ch01\obj\Debug\ch01.exe
文件 180 2009-08-18 22:00 Demo\ch01\ch01\obj\Debug\ch01.Form1.resources
文件 30208 2009-08-18 22:12 Demo\ch01\ch01\obj\Debug\ch01.pdb
文件 180 2009-08-18 20:52 Demo\ch01\ch01\obj\Debug\ch01.Properties.Resources.resources
文件 485 2009-08-18 20:48 Demo\ch01\ch01\Program.cs
文件 1340 2009-08-18 20:48 Demo\ch01\ch01\Properties\AssemblyInfo.cs
文件 2858 2009-08-18 20:48 Demo\ch01\ch01\Properties\Resources.Designer.cs
文件 5612 2009-08-18 20:48 Demo\ch01\ch01\Properties\Resources.resx
文件 1089 2009-08-18 20:48 Demo\ch01\ch01\Properties\Settings.Designer.cs
文件 249 2009-08-18 20:48 Demo\ch01\ch01\Properties\Settings.settings
文件 902 2009-08-18 20:48 Demo\ch01\ch01.sln
..A..H. 14336 2009-08-18 22:15 Demo\ch01\ch01.suo
文件 477 2009-08-18 21:45 Demo\readme.txt
目录 0 2009-08-18 20:59 Demo\ch01\ch01\obj\Debug\Refactor
目录 0 2009-08-18 20:48 Demo\ch01\ch01\obj\Debug\TempPE
目录 0 2009-08-18 20:52 Demo\ch01\ch01\bin\Debug
目录 0 2009-08-18 22:12 Demo\ch01\ch01\obj\Debug
目录 0 2009-08-18 20:48 Demo\ch01\ch01\bin
目录 0 2009-08-18 20:48 Demo\ch01\ch01\obj
目录 0 2009-08-18 20:48 Demo\ch01\ch01\Properties
............此处省略6个文件信息
- 上一篇:汇编语言编写的迷宫小游戏
- 下一篇:Qt实现游戏FlappyBird
相关资源
- Bresenham算法绘制线段并利用“橡皮筋
- 曲面拟合算法程序
- VpnHood:快速便携式VPN-源码
- Winhex 15 官方中文语言包
- Video Enhancer去除视频马赛克软件 v3.1完
- Cisco Enhanced Device Interface产品手册
- A new way to prepare MoO3/C for enhancing the
- TH upstream-inhibited ARHGAP12 subnetwork for
- 好用winhex16进制编辑器
- 推广的Tanh函数方法与形式分离变量法
- winhex exfat DBR模板
- WinHex 17.2 官方简体中文版 + 注册机
- winhex破解版,永久授权,亲测可以使
- Winhlp32 的 Windows 10 / Windows 8 解决方案
- Windows10下的winhlp32解決方案
- 论文研究 - 小麦/玉米杂种CENH3基因的
- 很好用的 查看BIN 格式的文件 WINHEX
- openHEVC-hm10.0
- 四元饱和硝酸盐水溶液体系{ H2O + NH
- β cyclodextrin-induced Fluorescence Enhan
- 破解版winhexCn
- xinhaoyuxitong_downcc.com.zip
- Unity无限滑动列表插件EnhancedScroller
- WinHex.19.9_Specialist License.7z
- DS-7808HW-SNH升级固件
- Signals and Systems习题答案Oppenheim第二版
- 直驱永磁同步风电机组建模及其控制
- Chrome扩展离线安装包crx
- SELinux by Example Using Security Enhanced Lin
- GreenHills 2017.7 编译手册
评论
共有 条评论