摘要: private void button1_Click(object sender, EventArgs e) { try { Process p = new Process(); p.StartInfo.FileName = "cmd.exe "; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p 阅读全文
posted @ 2011-07-28 23:55 小锋神 阅读(1984) 评论(0) 推荐(1)
摘要: 我们在做winform应用的时候,大部分情况下都会碰到使用多线程控制界面上控件信息的问题。然而我们并不能用传统方法来做这个问题,下面我将详细的介绍。 首先来看传统方法: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Thread thread = new Thread(ThreadFuntion); thread.IsBackground = true; thread.Start 阅读全文
posted @ 2011-07-28 22:22 小锋神 阅读(594) 评论(0) 推荐(0)
摘要: private void getDirectories(string path) { string[] fileNames = Directory.GetFiles(path); string[] directories = Directory.GetDirectories(path); foreach (string file in fileNames) { Console.WriteLine( "Filename:{0} ",file); } foreach (string dir in directories) { Console.WriteLine( "D 阅读全文
posted @ 2011-07-28 10:17 小锋神 阅读(2448) 评论(0) 推荐(1)