随笔分类 - C# 常用工具方法
摘要:功能:程序集注册工具(Regasm.exe),读取程序集中的元数据,并将所需的项添加到注册表中 使用REGASM.EXE注册工具,注册 E:\ClassLibrary1.dll 的COM组件 C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm /
阅读全文
摘要:/// <summary> /// 窗体动画函数 /// </summary> /// <param name="hwnd">指定产生动画的窗口的句柄</param> /// <param name="dwTime">指定动画持续的时间</param> /// <param name="dwFlag
阅读全文
摘要:生成公钥和私钥文件 using System.Security.Cryptography; using System.IO; /// <summary> /// 生成公钥、私钥 /// </summary> /// <param name="PrivateKeyPath">私钥文件保存路径,包含文件
阅读全文
摘要:using System; using System.Collections.Generic; using System.Text; using System.Management; using System.Security.Cryptography; using Microsoft.Win32;
阅读全文
摘要:using System; using System.Collections.Generic; using System.Windows.Forms; using System.Runtime.InteropServices; public class HotKeys { int keyid = 1
阅读全文
摘要:API声明: /// <summary> /// 获取指定窗口的设备场景 /// </summary> /// <param name="hwnd">将获取其设备场景的窗口的句柄。若为0,则要获取整个屏幕的DC</param> /// <returns>指定窗口的设备场景句柄,出错则为0</retu
阅读全文
摘要:通常我们把图片保存到数据库时是以二进制数据(byte[],字节数组 )保存的。 在代码中,我们可以把Image转化为byte[]: private byte[] ImageToByte(Image image) { MemoryStream ms = new MemoryStream(); if (
阅读全文