摘要: /// /// 读写INI文件的类。 /// public class INIHelper { // 读写INI文件相关。 [DllImport("kernel32.dll", EntryPoint = "WritePrivateProfileString", CharSet = CharSet.Ansi)] public static extern long Wri... 阅读全文
posted @ 2018-01-25 11:11 大漠苍狼~ 阅读(628) 评论(0) 推荐(0) 编辑
摘要: //注册表操作类 /// 注册表根节点类型 /// public enum WRegisterRootKeyType { HKEY_CLASSES_ROOT = 0, HKEY_CURRENT_USER = 1, HKEY_LOCAL_MACHINE = 2, HKEY_USERS = 3, HKEY_CURRENT_CONFIG = 4 } //... 阅读全文
posted @ 2018-01-25 11:10 大漠苍狼~ 阅读(435) 评论(0) 推荐(0) 编辑
摘要: delegate void SetTextCallBack(string text); private void addlog(string text) { if (this.textBox1.InvokeRequired) { SetTextCallBack stcb = new ... 阅读全文
posted @ 2018-01-25 11:04 大漠苍狼~ 阅读(167) 评论(0) 推荐(0) 编辑
摘要: /// /// 一个示例方法 - 无参数 /// private void TestMethod() { Console.WriteLine("我是测试线程"); } //无参数线程的创建 Thread Thd = new Thread(TestMethod); /// /// 一个示例方法 - 有参数 /// private void TestMethod(int Obj) ... 阅读全文
posted @ 2018-01-25 11:02 大漠苍狼~ 阅读(146) 评论(0) 推荐(0) 编辑
摘要: //委托的最简便的写法 this.Invoke(new Action(() => { //这里面写需要进行的委托操作 //比如线程操作界面的语句等 })); //举例 this.Invoke(new Action(() => { this.TextBox1.Text = "12345"; })); //举例 this.Invoke(new Action(() => ... 阅读全文
posted @ 2018-01-25 10:59 大漠苍狼~ 阅读(141) 评论(0) 推荐(0) 编辑
摘要: //如果电脑上安装了IE8或者之后版本的IE浏览器,Webbrowser控件会使用IE7兼容模式来显示网页内容。解决方法是在注册表中为你的进程指定引用IE的版本号。 //比如我的程序叫做a.exe //对于32位程序 //HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROW... 阅读全文
posted @ 2018-01-25 10:55 大漠苍狼~ 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 在c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0); 等他们各自的方法不一样,下面我们就来详细介绍一下。 1.this.Close 阅读全文
posted @ 2018-01-25 10:41 大漠苍狼~ 阅读(204) 评论(0) 推荐(0) 编辑
摘要: namespace AliLoginForm { public class MyIECookie { //[DllImport("wininet.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.Cdecl)] //st... 阅读全文
posted @ 2018-01-25 09:56 大漠苍狼~ 阅读(3144) 评论(0) 推荐(0) 编辑