随笔分类 - C#笔记
摘要:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System....
阅读全文
摘要:1:在工程目录增加dll目录,然后将dll文件复制到此目录,例如: 2:增加引用,定位到工程的dll目录,选中要增加的dll文件 3:修改dll文件夹下面的dll文件属性 选中嵌入式资源,不复制。 4:增加dll加载代码
阅读全文
摘要:1:Winform应用通过mshtml操作IE浏览器DOM时,第一次运行正常,点击第二次时错误信息如下 A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in openie0
阅读全文
摘要:1:通过SPY++获得地址栏的层次结构,然后一层一层获得 2:代码 3:运行结果
阅读全文
摘要:1:打开VS2012新建工程以及打开项目报一下错误提示 2:是由于.NET Framework 4.5 补丁造成的 从:https://www.microsoft.com/zh-CN/download/details.aspx?id=36020 下载补丁安装即可。
阅读全文
摘要:static void Main(string[] args) { new ConsoleCtrl(); Console.Read(); } class ConsoleCtrl { [DllImport("User32.dll", EntryPoint = "FindWind...
阅读全文
摘要:对于要进行序列化操作的对象需要添加[Serializable]声明,例如:namespace filetest{ [Serializable] //必须添加序列化特性 class User { public String name; public int...
阅读全文
摘要:namespace filetest{ class FileUtil { public static void WriteFile(string file) { using (FileStream fs = new FileStream(...
阅读全文
摘要:private void btnOpen_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { ...
阅读全文
摘要:1:对象初始化操作C#3.0中引入了新的对象初始化方法,之前的方式:User user = new User();user.name = "test";user.age = 10;现在的方式:User user = new User(){name="test",age=10};变得更简洁,可读性更好...
阅读全文