2014年3月24日

打开文件夹

摘要: // 打开文件夹1 System.Diagnostics.Process.Start(src); //src是地址 这个是打开文件夹//以默认方式打开文件1 System.Diagnostics.Process p=new System.Diagnostics.Process(); 2 //直接指定文件名,系统工程会自己找到打开这个文件的程序而打开这个文件,如Excel文件 3 p.StartInfo.FileName=fileName; //example:@"D:\人员信息.xls"; 4 p.Start();来源1 System.Diagnostics.Process 阅读全文
posted @ 2014-03-24 20:05 13m0n 阅读(260) 评论(0) 推荐(0) 编辑

进度条的简单应用

摘要: 1 using System.Windows.Form; 2 3 private System.Windows.Forms.ProgressBar progressBar1; 4 this.progressBar1 = new System.Windows.Forms.ProgressBar(); 5 this.progressBar1.Maximum = 200; //进度条的最大值是200 6 this.progressBar1.Minimum = 1; //进度条的最小值是1 7 9 this.progressBar1.Step = 1; //进度条... 阅读全文
posted @ 2014-03-24 19:52 13m0n 阅读(192) 评论(0) 推荐(0) 编辑

初始正则表达式

摘要: 1 using System.Text.RegularExpressions;2 3 4 string regext = ".*\\s+.{41}\\s+href=\"http:\\/\\/([\\w\\-\\.,@?^=%&amp;:/~\\+#]*[\\w\\-\\@?^=%&amp;/~\\+#])?\">[0-9a-zA-Z\\u0391-\\uFFE5]+(.*\\s+){5}(<.*\\s+){1,3}"; //正则表达式内容regext5 6 foreach (Match mi in Regex.Matches( 阅读全文
posted @ 2014-03-24 19:24 13m0n 阅读(182) 评论(0) 推荐(0) 编辑

下载网页

摘要: 这是一个下载网页非常简单,但是非常有限的方法.1 using System.Net;2 3 var wc = new WebClient(); //新建一个WebClient对象 wc4 string href = wz; //网址为字符串 wz5 var html = wc.DownloadString(href); //html 就是wz的网页内容得到这个html就可以做一些自己想做的事情.此方法检索指定的资源。下载该资源之后,此方法使用在Encoding属性中指定的编码将该资源转换为String。WebClient client = new WebClie... 阅读全文
posted @ 2014-03-24 19:07 13m0n 阅读(229) 评论(0) 推荐(0) 编辑

StreamWriter

摘要: public StreamWriter( string path, bool append)参数path类型:System.String要写入的完整文件路径。append类型:System.Boolean若要追加数据到该文件中,则为true;若要覆盖该文件,则为false。如果指定的文件不存在,该参数无效,且构造函数将创建一个新文件。 阅读全文
posted @ 2014-03-24 16:07 13m0n 阅读(192) 评论(0) 推荐(0) 编辑