2012年9月25日

C#操作XML方法详解

摘要: C#操作XML方法详细介绍using System.Xml;//初始化一个xml实例XmlDocument xml=new XmlDocument();//导入指定xml文件xml.Load(path);xml.Load(HttpContext.Current.Server.MapPath("~/file/bookstore.xml"));//指定一个节点XmlNode root=xml.SelectSingleNode("/root");//获取节点下所有直接子节点XmlNodeList childlist=root.ChildNodes;//判断该节 阅读全文

posted @ 2012-09-25 20:49 程序猴chengxuhou.com 阅读(591) 评论(1) 推荐(1) 编辑

C#进程的使用方法详解

摘要: 关于C#进程的一些学习,包含了进程的各个方面的知识,欢迎阅读C#进程学习,本机中的所有进程的监测与控制转载请注明出处:http://www.cnblogs.com/minotmin/using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Diagnostics;namespace ProcessMonitor{ 阅读全文

posted @ 2012-09-25 20:42 程序猴chengxuhou.com 阅读(1173) 评论(0) 推荐(2) 编辑

C#线程的使用

摘要: C#线程的使用简单示例代码如下:using System;using System.Threading;class Program{ static void Main(string[] args) { Thread.CurrentThread.Name = "主线程"; Thread thread1 = new Thread(new ThreadStart(Program.Output)); thread1.Name = "子线程1"; thread1.Priority = ThreadPriority.Lowest; ... 阅读全文

posted @ 2012-09-25 17:25 程序猴chengxuhou.com 阅读(7227) 评论(0) 推荐(1) 编辑

C#LINQ查询表达式用法

摘要: >代码如下,谢谢阅读,控制台应用程序:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Xml.Linq;namespace LinqQueryDemo{ class Student { public string Name { get; set; } public bool Sex { get; set; } public int Age { get; set; } } class Program { static 阅读全文

posted @ 2012-09-25 17:21 程序猴chengxuhou.com 阅读(4034) 评论(0) 推荐(0) 编辑

C#Lambda表达式的用法

摘要: 示例代码如下,控制台应用程序:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace LambdaExpressionDemo{ delegate void AddHandler(int a, int b); class Program { event AddHandler AddEvent; static void Main(string[] args) { int x = 10; int y = 5; Program program = new Program() 阅读全文

posted @ 2012-09-25 17:17 程序猴chengxuhou.com 阅读(477) 评论(0) 推荐(0) 编辑

C#3.0新特性之匿名类型

摘要: 示例代码如下,控制台应用程序:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace AnonymousTypeDemo{ class Program { static void Main(string[] args) { var personWang = new { Name = "张三", Sex = true, Age = 27 }; Console.WriteLine("Name属性:{0}",personWang.Na 阅读全文

posted @ 2012-09-25 17:14 程序猴chengxuhou.com 阅读(177) 评论(0) 推荐(0) 编辑

C#3.0新特性之隐式类型化局部变量

摘要: 示例代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace HiddenClassLocalVariablesDemo{ class Program { static void Main(string[] args) { var intAge = 27; var stringName = "张三"; var program = new Program(); if (intAge.GetType() == typeof(Int32)) Co 阅读全文

posted @ 2012-09-25 17:11 程序猴chengxuhou.com 阅读(414) 评论(0) 推荐(0) 编辑

导航