上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 35 下一页
摘要: 在部署一个vs2008环境下的Winform应用程序时,因为引用一个Html编辑器,而用到了Microsoft mshtml.dll程序集, 版本为7.0.3300.0,对应文件在 E:\Vs2008的安装目录\Visual Studio Tools for Office\PIA\Office11\ 阅读全文
posted @ 2011-06-15 14:43 把爱延续 阅读(530) 评论(1) 推荐(1) 编辑
摘要: C#两种创建快捷方式的方法用WSH直接创建快捷方式:1.首先要添加引用.添加引用的方法非常简单,右击你的项目并选择添加引用,选择 COM 选项卡并选择 Windows Script Host Object Model2.引用命名空间using System.Runtime.InteropServic... 阅读全文
posted @ 2011-06-15 10:06 把爱延续 阅读(15232) 评论(1) 推荐(1) 编辑
摘要: Paste html from Clipboard 可解决中文乱码问题。MemoryStream ms = Clipboard.GetData("Html Format") as MemoryStream; if (ms == null) { return; } ms.Position = 0; byte[] vBytes = new byte[ms.Length]; ms.Read(vBytes, 0, (int)ms.Length); string strFullHtml = Encoding.UTF8.GetString(vBytes); // utf-8 阅读全文
posted @ 2011-06-11 22:11 把爱延续 阅读(563) 评论(0) 推荐(0) 编辑
摘要: Copy Html To Clipboard 可解决中文乱码问题。 private void CopyHtmlToClipBoard(string html) { Encoding enc = Encoding.UTF8; string begin = "Version:0.9\r\nStartHTML:{0:000000}\r\nEndHTML:{1:000000}\r\nStartFragment:{2:000000}\r\nEndFragment:{3:000000}\r\n"; string html_begin = "<html>\r\n&l 阅读全文
posted @ 2011-06-11 22:08 把爱延续 阅读(1478) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/gaoweipengWin32的API函数是微软自己的东西,可以直接在C#中直接调用,在做WinForm时还是很有帮助的。有时候我们之直接调用Win32 的API,可以很高效的实现想要的效果。usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Runtime.InteropServices;namespaceWindowsAPI{classCSharp_Win32Api{#regionUser32.dll函数///& 阅读全文
posted @ 2011-06-07 17:34 把爱延续 阅读(734) 评论(0) 推荐(0) 编辑
摘要: 昨天经过网友提醒,提取汉字拼音的方法可以使用微软的一个类库 Visual Studio International Pack ,今天试了一试,确实好用!下面分享下使用方法:首先下载Visual Studio International Pack 2.0,官方下载地址:http://www.microsoft.com/downloads/zh-cn/details.aspx?FamilyID=7D1DF9CE-4AEE-467F-996E-BEC826C5DAA2。1.0 SR1 下载地址:http://www.microsoft.com/zh-cn/download/details.aspx? 阅读全文
posted @ 2011-06-04 10:14 把爱延续 阅读(1485) 评论(7) 推荐(2) 编辑
摘要: .NET的反射(Reflection)是非常完善和强大的,例如有名的.NET反编译工具Red Gate's .NET Reflector就是使用了.NET自身的反射机制,这里有一个比较简单的实例(使用控制台程序),看看.NET中如何使用反射。using System; using System.Reflection; namespace Mengliao.CSharp.C13.S02 { class MyClass { private int count; public MyClass(int value) { count = value; } public void m1() { C 阅读全文
posted @ 2011-06-01 16:04 把爱延续 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 所谓线程同步,就是多个线程之间在某个对象上执行等待(也可理解为锁定该对象),直到该对象被解除锁定。C#中对象的类型分为引用类型和值类型。CLR在这两种类型上的等待是不一样的。我们可以简单的理解为在CLR中,值类型是不能被锁定的,也即:不能在一个值类型对象上执行等待。而在引用类型上的等待机制,则分为两类:锁定和信号同步。锁定,使用关键字lock和类型Monitor。两者没有实质区别,前者其实是后者的语法糖。这是最常用的同步技术;本建议我们讨论的是信号同步。信号同步机制中涉及的类型都继承自抽象类WaitHandle,这些类型有EventWaitHandle(类型化为AutoResetEvent、M 阅读全文
posted @ 2011-06-01 13:27 把爱延续 阅读(683) 评论(0) 推荐(0) 编辑
摘要: // 需要设置ListView的OwnerDraw属性为 true // 用以改变标题的颜色 private void listView_DrawColumnHeader(object sender, DrawListViewColumnHeaderEventArgs e) { e.Graphics.FillRectangle(new SolidBrush(Color.Red), e.Bounds); e.DrawText(); } private void listView_DrawItem(object sender, DrawListViewItemEventArgs e) { e.D. 阅读全文
posted @ 2011-05-31 17:01 把爱延续 阅读(9547) 评论(1) 推荐(2) 编辑
摘要: 第一个种方式利用Win32API 读取文件头获取Mime-Type [DllImport(@"urlmon.dll", CharSet = CharSet.Auto)] private extern static System.UInt32 FindMimeFromData( System.UInt32 pBC, [MarshalAs(UnmanagedType.LPStr)] System.String pwzUrl, [MarshalAs(UnmanagedType.LPArray)] byte[] pBuffer, System.UInt32 cbSize, [Mar 阅读全文
posted @ 2011-05-30 11:14 把爱延续 阅读(815) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 35 下一页