资源简介
[北风网牛牛讲师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
相关资源
- winhex 模板(102个模板)
- nhibernate.dll
- 异步HTTP请求及异步HTTP单元基于autoU
- 一个delphi封装的WinHttp
- Speech Enhancement Theory and Practice语音增强
- OpenHaptics_API_Reference 完整API翻译
- zw_xinhuojianke-10555810-PSO工具箱.zip
- jmeter.results.shanhe.me.xsl和jmeter-results-
- nhibernate_template_4个模板文件
- OpenHardwareMonitor-v0.9.2.zip
- 自己分装的一个winhttp类
- nhibernet最完整中文版教程1(chm格式)
-
applicationHost.config xm
l格式错误解决 - IOSrv_OMRONHL
- NHS3100系统板开发环境LPCXpresso的安装及
- Sublime Text2超好用的侧栏插件SideBarEn
- 关于Unhandled event loop exception No more h
- 用Bresenham算法画任意斜率的线
- ue2638_1 Academic Phrasebank 2015b enhanced ed
-
LSCommon
helper和LSGISHelper - vs2005下使用winhttp的头文件和lib文件
- RunHiddenConsole
- SkinH_EL或者SkinSharp 最新1.0.6.6破解版
- zw_u014483560-7129237-sujunhao.zip
- NHibernate-2.1.2.GA-bin.zip
- 3D-QSAR and docking studies of suberoylanilide
- Inhibition of gastric motility by endogenous H
- Inhibitory Effect on Monoamine oxidase of Lact
- UV-irradiation-enhanced ferromagnetism in hexa
- Coercivity enhancement of sintered Nd-Fe-B mag
评论
共有 条评论