2013年8月8日
摘要: 在Group里面添加和删除User:public void AddUserToGroup(string userId, string groupName) { try { using (PrincipalContext pc = new PrincipalContext(ContextType.Domain, "COMPANY")) { GroupPrincipal group = GroupPrincipal.FindByIdentity(pc, groupName); group.Members.Ad... 阅读全文
posted @ 2013-08-08 17:15 啊風 阅读(325) 评论(0) 推荐(0) 编辑
  2013年8月2日
摘要: [DllImport("winmm.dll")] private static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume); [DllImport("winmm.dll")] pr... 阅读全文
posted @ 2013-08-02 14:16 啊風 阅读(945) 评论(0) 推荐(0) 编辑
  2013年7月23日
摘要: 在使用Microsoft.Interop.Excel对象的时候_application.Quit()并不能彻底关闭Excel进程,原因是没有释放掉非托管组建的引用。 System.Runtime.InteropServices.Marshal.FinalReleaseComObject(book);... 阅读全文
posted @ 2013-07-23 16:47 啊風 阅读(452) 评论(0) 推荐(0) 编辑
  2013年7月9日
摘要: /// /// Read data in excel file to datatable /// /// Excel file name /// Which sheet to read /// public... 阅读全文
posted @ 2013-07-09 15:05 啊風 阅读(1932) 评论(0) 推荐(0) 编辑
  2012年12月3日
摘要: 一.将XML文件反序列化为实体类对象 1. 通常程序的配置信息都保存在程序或者网站的专门的配置文件中(App.config/web.config)。但是现在为了演示XML序列化和反序列化,将配置信息保存在一个XML文件(config.xml)中,通过反序列化将配置信息读取出来保存到一个单独的类(C... 阅读全文
posted @ 2012-12-03 16:52 啊風 阅读(34129) 评论(3) 推荐(5) 编辑
  2012年1月2日
摘要: 最近在学习GDI,发现网上几篇文章在讲截图软件制作方法,学习了一点知识,在这里分享一下. 主要是调用WinAPI中的函数来完成主要功能.关键的函数有2个,一个是CreateDC,利用这个函数来创建一个显示器屏幕的DC(设备环境),作为源DC,再创建一个Image图像,通过这个图像的Graphi... 阅读全文
posted @ 2012-01-02 08:20 啊風 阅读(2948) 评论(0) 推荐(0) 编辑
  2011年12月18日
摘要: 1. 文件夾監控(監測文件夾中的文件動態): //MSDN上的例子 public class Watcher { public static void Main() { Run(); } [... 阅读全文
posted @ 2011-12-18 13:57 啊風 阅读(725) 评论(0) 推荐(0) 编辑
  2011年10月28日
摘要: 一. 首先要清楚一些基本的页面布局中一些常用的js 1. clientHeight : 都认为是内容可视区域的高度,也就是说页面浏览器中可以看到内容的这个区域的高度,一般是最后一个工具条以下到状态栏以上的这个区域,与页面内容无关。 2. clientLeft,clientTop:这两个返回的是元... 阅读全文
posted @ 2011-10-28 13:58 啊風 阅读(246) 评论(0) 推荐(0) 编辑
  2011年10月20日
摘要: 当一个类中包含数组或者集合成员时,用索引器可以大大简化对数组或者集合成员的存取操作。 使用方式如下: [修饰符] 数据类型 this[索引类型 index]{ get{//获得属性的代码} ... 阅读全文
posted @ 2011-10-20 08:44 啊風 阅读(212) 评论(0) 推荐(0) 编辑
  2011年10月18日
摘要: 1. 百度上的一个有关Attribute的问题 //自定义了一个Attribute [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] class IStudentAttribute : Attribute { ... 阅读全文
posted @ 2011-10-18 13:05 啊風 阅读(343) 评论(0) 推荐(0) 编辑