代码改变世界

C# 通过线程更新UI

2014-02-20 22:23 by 每天努力一点点, 232 阅读, 0 推荐, 收藏, 编辑
摘要:摘自:http://msdn.microsoft.com/zh-cn/library/ms171728(en-us,VS.80).aspx关键代码(form中增加):delegate void SetTextCallback(string text);private Thread demoThread = null;private void setTextSafeBtn_Click( object sender, EventArgs e) { this.demoThread = new Thread(new ThreadStart(this.ThreadProcSafe... 阅读全文

C# 知识点收集

2014-02-17 22:36 by 每天努力一点点, 191 阅读, 0 推荐, 收藏, 编辑
摘要:1. 数组复制byte[] source;byte[] dest;int srcOffset = 0;int dstOffset = 0;int count = 10;System.Buffer.BlockCopy(source, srcOffset, dest, dstOffset, count);2.string转字节数组byte[] inputByte = System.Text.Encoding.Unicode.GetBytes(text);byte[] inputByte = System.Text.Encoding.ASCII.GetBytes(text);3.字节数组转strin 阅读全文

C#优秀开源资料收集

2014-02-13 22:23 by 每天努力一点点, 200 阅读, 0 推荐, 收藏, 编辑
摘要:1. 把对命令行程序的调用封装起来,通过程序里进行输入,调用命令行程序的输出显示在程序中http://www.codeproject.com/Articles/335909/Embedding-a-Console-in-a-C-Application2. c# 实现的几个gnu程序(如grep等)http://www.codeproject.com/Articles/4638/Shell-NET3. ssh客户端SharpSSH:http://sourceforge.net/projects/sharpssh/ 阅读全文

c#实现文件拖放

2014-02-13 22:12 by 每天努力一点点, 731 阅读, 0 推荐, 收藏, 编辑
摘要:1. 选择form窗口,在事件分别双击双击DragDrop和DragEnterprivate void Form1_DragDrop(object sender, DragEventArgs e) { Array fileArr = ((System.Array)e.Data.GetData(DataFormats.FileDrop)); for (int i = 0; i < fileArr.Length; i++) { this.textBox1.AppendText(fileAr... 阅读全文

定制putty,实现自动登陆

2014-02-11 22:27 by 每天努力一点点, 206 阅读, 0 推荐, 收藏, 编辑
摘要:http://www.drdobbs.com/cpp/automate-ssh-logins-by-customizing-putty/231700268 阅读全文

C# 调用外部程序,并获取输出和错误信息

2014-01-27 22:40 by 每天努力一点点, 1443 阅读, 0 推荐, 收藏, 编辑
摘要:1. 同步模式public void exec(string exePath, string parameters) { System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(); psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; psi.WindowStyle = System.Diagnos... 阅读全文

制作安装包工具NSIS

2014-01-25 22:58 by 每天努力一点点, 177 阅读, 0 推荐, 收藏, 编辑
摘要:NSIS下载地址:http://nsis.sourceforge.net/Download编辑工具:NIS Edit下载地址:http://soft.hao123.com/soft/appid/10708.html 阅读全文

C++ builder 生成以管理员身份运行的exe

2014-01-25 22:11 by 每天努力一点点, 517 阅读, 0 推荐, 收藏, 编辑
摘要:转自:http://bbs.csdn.net/topics/310225109#post-312177603,稍微做了一点修改创建一个文本文件,命名为123.manifest,内容如下: 创建文件123.rc,内容如下:124"123.manifest"BCB中打你的工程,选择菜单上的Project-->Addtoproject-->找到刚才创建的123.rc,添加进来编译就行了 阅读全文

c# 编程添加控件

2014-01-12 22:55 by 每天努力一点点, 281 阅读, 0 推荐, 收藏, 编辑
摘要:Button b = new Button();//创建一个新的按钮 b.Text = "test";//添加到panel1中panel1.Controls.Add(b); 阅读全文

c# 读xml文件

2014-01-12 22:50 by 每天努力一点点, 143 阅读, 0 推荐, 收藏, 编辑
摘要:XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("cmdCfg.xml"); XmlNodeList nodeList = xmlDoc.SelectSingleNode("config").ChildNodes; if (nodeList != null) { foreach (XmlNode cmdNode in nodeList) { XmlElem... 阅读全文