摘要: 浅拷贝是指将对象内的数据完全一致的复制,深拷贝不是这样,它可以将内部的数据按照需要用特殊的方法拷贝,比如说对象内部有一个动态数组,浅拷贝只拷贝指针,而深拷贝可以重新申请空间并将数据复制过来。看代码:using System;using System.Collections.Generic;using System.Text;namespace NET.NST.Third.DeepCopy{ public class Program { static void Main(string[] args) { DeepCopy dc = new DeepCopy(); dc._i = 10; dc._ 阅读全文
posted @ 2011-06-05 15:31 brainmao 阅读(543) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;namespace NET.MST.Fifth.UseFileSystem_fsw{ class UseFS_fsw { //退出程序命令 private const String Exit = "exit"; //监视的文件夹 private const String Folder = "C:\\Test"; private FileSystemWatcher _fsw; public UseF 阅读全文
posted @ 2011-06-03 21:31 brainmao 阅读(569) 评论(2) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;namespace NET.MST.Sixth.Reenter{ class Reenter { //用来造成线程同步问题的静态成员 private static int TestInt1=0; private static int TestInt2 = 0; private static object locko = new object(); static void Main(string[] args) { Console.WriteLine("Sys 阅读全文
posted @ 2011-06-02 21:35 brainmao 阅读(1803) 评论(0) 推荐(0) 编辑
摘要: 上篇文章中提到XML转换问题,有些朋友颇有疑问,后期答复详解,这次带来使用XmlDocument读写节点属性using System;using System.Xml;namespace NET.MST.Tenth.UseXmlDocument{ partial class UseXmlDocument { static void Main(string[] args) { String path = "..\\..\\Test.xml"; XmlDocument xml = new XmlDocument(); xml.Load(path); Console.WriteL 阅读全文
posted @ 2011-06-01 09:56 brainmao 阅读(2468) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Xml;using System.Data;using System.Text;using System.IO;namespace NET.MST.Tenth.XmlAndDataSet{ partial class XmlAndDataSet { static void Main(string[] args) { Console.WriteLine("从XML文档转换到DataSet:"); DataSet ds = ConvertXMLFileToDataSet("..\\..\\Test.xml" 阅读全文
posted @ 2011-05-31 11:38 brainmao 阅读(995) 评论(2) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;namespace NET.MST.Fourth.StringByte{ class StringByte { static void Main(string[] args) { String s = "我是字符串,I am string"; //字节数组转换到字符串 Byte[] utf8 = StringToByte(s, Encoding.UTF8); Byte[] gb2312 = StringToByte(s, Encoding.GetE 阅读全文
posted @ 2011-05-29 22:29 brainmao 阅读(7585) 评论(0) 推荐(1) 编辑
摘要: 奇偶分割:using System;using System.Collections.Generic;using System.Text;namespace NET.MST.Thirteenth.EvenOddPartition{ partial class EvenOddPartition { /// <summary> /// 测试奇偶分割算法 /// </summary> static void Main(string[] args) { int[] data = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; PrintArray(d 阅读全文
posted @ 2011-05-28 00:16 brainmao 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 斐波那契数列又因数学家列昂纳多·斐波那契以兔子繁殖为例子而引入,故又称为“兔子数列”。using System;using System.Collections.Generic;namespace NET.MST.Thirteenth.Phabe{ /// <summary> /// 使用Phabe类型 /// </summary> class MainClass { static void Main(string[] args) { //计算第50个元素 Console.WriteLine("第50个元素是:{0}", Phabe.Get 阅读全文
posted @ 2011-05-26 21:51 brainmao 阅读(1406) 评论(0) 推荐(0) 编辑
摘要: 最近在完成一个拿得出手的小型项目,主要对供求网站信息进行发布、管理,等操作,今天正好完善到全局搜索功能,仅供大家参考学习:效果图:前台代码:<table align="center" cellpadding="0" cellspacing="0" width="184"> <tr> <td align="left" class="henhong"> 输入关键字</td> </tr> <tr> <td 阅读全文
posted @ 2011-05-25 17:34 brainmao 阅读(665) 评论(0) 推荐(0) 编辑
摘要: 本次代码主要为了演示获取当前计算机上的驱动信息:本人计算机效果如下所示:cs代码:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { th 阅读全文
posted @ 2011-05-24 19:32 brainmao 阅读(338) 评论(0) 推荐(0) 编辑