123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656 |
- using System;
- using System.Runtime.InteropServices;
- using System.ComponentModel;
- using System.Text;
- namespace LYFZ.WinAPI
- {
- /// <summary>
- /// Wind32API声明
- /// </summary>
- public class Win32
- {
- public const int GWL_EXSTYLE = -20;
- public const int WS_EX_TRANSPARENT = 0x00000020;
- public const int WS_EX_LAYERED = 0x00080000;
- public const int WM_COPYDATA = 0x004A;
- public const int USER = 0x0400;
- public const int WM_TEST_STR = USER + 101;
- public const int WM_MSG = USER + 102;
- [System.Runtime.InteropServices.DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")]
- public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize);
- /// <summary>
- /// 发送消息
- /// </summary>
- /// <param name="hWnd"></param>
- /// <param name="Msg"></param>
- /// <param name="wParam"></param>
- /// <param name="lParam"></param>
- /// <returns></returns>
- [DllImport("User32.dll", EntryPoint = "SendMessage")]
- private static extern int SendMessage(IntPtr hWnd,int Msg,int wParam,ref COPYDATASTRUCT lParam);
- /// <summary>
- /// 查找窗体
- /// </summary>
- /// <param name="lpClassName"></param>
- /// <param name="lpWindowName"></param>
- /// <returns></returns>
- [DllImport("User32.dll", EntryPoint = "FindWindow")]
- private static extern int FindWindow(string lpClassName, string lpWindowName);
- public struct COPYDATASTRUCT
- {
- public IntPtr dwData;
- public int cbData;
- [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)]
- public string lpData;
- }
- /// <summary>
- /// 移动窗体
- /// </summary>
- /// <param name="intPtr"></param>
- public static void FormMobile(IntPtr intPtr)
- {
- //释放鼠标焦点捕获
- Win32.ReleaseCapture();
- //向当前窗体发送拖动消息
- Win32.SendMessage(intPtr, 0x0112, 0xF011, 0);
- }
- /// <summary>
- /// Size大小
- /// </summary>
- [StructLayout(LayoutKind.Sequential)]
- public struct Size
- {
- public Int32 cx;
- public Int32 cy;
- public Size(Int32 x, Int32 y)
- {
- cx = x;
- cy = y;
- }
- }
- /// <summary>
- ///
- /// </summary>
- [StructLayout(LayoutKind.Sequential, Pack = 1)]
- public struct BLENDFUNCTION
- {
- public byte BlendOp;
- public byte BlendFlags;
- public byte SourceConstantAlpha;
- public byte AlphaFormat;
- }
- [StructLayout(LayoutKind.Sequential)]
- public struct Point
- {
- public Int32 x;
- public Int32 y;
- public Point(Int32 x, Int32 y)
- {
- this.x = x;
- this.y = y;
- }
- }
- public const byte AC_SRC_OVER = 0;
- public const Int32 ULW_ALPHA = 2;
- public const byte AC_SRC_ALPHA = 1;
- /// <summary>
- /// 从左到右显示
- /// </summary>
- public const Int32 AW_HOR_POSITIVE = 0x00000001;
- /// <summary>
- /// 从右到左显示
- /// </summary>
- public const Int32 AW_HOR_NEGATIVE = 0x00000002;
- /// <summary>
- /// 从上到下显示
- /// </summary>
- public const Int32 AW_VER_POSITIVE = 0x00000004;
- /// <summary>
- /// 从下到上显示
- /// </summary>
- public const Int32 AW_VER_NEGATIVE = 0x00000008;
- /// <summary>
- /// 若使用了AW_HIDE标志,则使窗口向内重叠,即收缩窗口;否则使窗口向外扩展,即展开窗口
- /// </summary>
- public const Int32 AW_CENTER = 0x00000010;
- /// <summary>
- /// 隐藏窗口,缺省则显示窗口
- /// </summary>
- public const Int32 AW_HIDE = 0x00010000;
- /// <summary>
- /// 激活窗口。在使用了AW_HIDE标志后不能使用这个标志
- /// </summary>
- public const Int32 AW_ACTIVATE = 0x00020000;
- /// <summary>
- /// 使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时,这个标志就被忽略
- /// </summary>
- public const Int32 AW_SLIDE = 0x00040000;
- /// <summary>
- /// 透明度从高到低
- /// </summary>
- public const Int32 AW_BLEND = 0x00080000;
- /// <summary>
- /// 执行动画
- /// </summary>
- /// <param name="whnd">控件句柄</param>
- /// <param name="dwtime">动画时间</param>
- /// <param name="dwflag">动画组合名称</param>
- /// <returns>bool值,动画是否成功</returns>
- [DllImport("user32")]
- public static extern bool AnimateWindow(IntPtr whnd, int dwtime, int dwflag);
- /// <summary>
- ///
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)]//SendMessageTimeout是在user32.dll中定义的
- public static extern IntPtr SendMessageTimeout(IntPtr windowHandle,uint Msg,IntPtr wParam,IntPtr lParam,SendMessageTimeoutFlags flags, uint timeout,out IntPtr result);
- [Flags]
- public enum SendMessageTimeoutFlags : uint
- {
- SMTO_NORMAL = 0x0000,
- SMTO_BLOCK = 0x0001,
- SMTO_ABORTIFHUNG = 0x0002,
- SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
- }
-
- /// <summary>
- /// <para>该函数将指定的消息发送到一个或多个窗口。</para>
- /// <para>此函数为指定的窗口调用窗口程序直到窗口程序处理完消息再返回。</para>
- /// <para>而函数PostMessage不同,将一个消息寄送到一个线程的消息队列后立即返回。</para>
- /// return 返回值 : 指定消息处理的结果,依赖于所发送的消息。
- /// </summary>
- /// <param name="hWnd">要接收消息的那个窗口的句柄</param>
- /// <param name="Msg">消息的标识符</param>
- /// <param name="wParam">具体取决于消息</param>
- /// <param name="lParam">具体取决于消息</param>
- [DllImport("User32.dll", CharSet = CharSet.Auto, EntryPoint = "SendMessageA")]
- public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
- [DllImport("user32.dll")]
- public static extern bool ReleaseCapture();
- [DllImport("user32")]
- public static extern void mouse_event(int dwFlags, int dx, int dy, int dwData, int dwExtraInfo);
- [DllImport("gdi32.dll")]
- public static extern int CreateRoundRectRgn(int x1, int y1, int x2, int y2, int x3, int y3);
- [DllImport("user32.dll")]
- public static extern int SetWindowRgn(IntPtr hwnd, int hRgn, Boolean bRedraw);
- [DllImport("user32", EntryPoint = "GetWindowLong")]
- public static extern int GetWindowLong(
- IntPtr hwnd, int nIndex);
- [DllImport("user32.dll")]
- public static extern int SetWindowLong(
- IntPtr hwnd, int nIndex, int dwNewLong);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
- [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern IntPtr GetDC(IntPtr hWnd);
- [DllImport("gdi32.dll", ExactSpelling = true)]
- public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObj);
- [DllImport("user32.dll", ExactSpelling = true)]
- public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int DeleteDC(IntPtr hDC);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int DeleteObject(IntPtr hObj);
- [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern int UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref Point pptDst, ref Size psize, IntPtr hdcSrc, ref Point pptSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags);
- [DllImport("gdi32.dll", ExactSpelling = true, SetLastError = true)]
- public static extern IntPtr ExtCreateRegion(IntPtr lpXform, uint nCount, IntPtr rgnData);
- [DllImport("user32.dll")]
- public static extern int ExitWindowsEx(int x, int y);
- #region USB设备插入或拨出监控
- public const int WM_DEVICECHANGE = 0x0219;
- public const int DBT_DEVICEARRIVAL = 0x8000, // systemdetected a new device
- DBT_DEVICEREMOVECOMPLETE = 0x8004; // device is gone
- public const int DEVICE_NOTIFY_WINDOW_HANDLE = 0,
- DEVICE_NOTIFY_SERVICE_HANDLE = 1;
- public const int DBT_DEVTYP_DEVICEINTERFACE = 0x00000005; // deviceinterface class
- public static Guid GUID_DEVINTERFACE_USB_DEVICE = new Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED");
- [StructLayout(LayoutKind.Sequential)]
- public class DEV_BROADCAST_HDR
- {
- public int dbcc_size;
- public int dbcc_devicetype;
- public int dbcc_reserved;
- }
- [StructLayout(LayoutKind.Sequential)]
- public class DEV_BROADCAST_DEVICEINTERFACE
- {
- public int dbcc_size;
- public int dbcc_devicetype;
- public int dbcc_reserved;
- public Guid dbcc_classguid;
- public short dbcc_name;
- }
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public class DEV_BROADCAST_DEVICEINTERFACE1
- {
- public int dbcc_size;
- public int dbcc_devicetype;
- public int dbcc_reserved;
- [MarshalAs(UnmanagedType.ByValArray, ArraySubType=UnmanagedType.U1, SizeConst=16)]
- public byte [] dbcc_classguid;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst=128)]
- public char [] dbcc_name;
- }
- [DllImport("user32.dll", SetLastError=true)]
- public static extern IntPtr RegisterDeviceNotification( IntPtr hRecipient, IntPtr NotificationFilter, Int32 Flags);
- [DllImport("kernel32.dll")]
- public static extern int GetLastError();
- /// <summary>
- /// 注册设备通知
- /// </summary>
- /// <param name="Handle"></param>
- public static void RegisterDeviceNotification(IntPtr Handle)
- {
- Win32.DEV_BROADCAST_DEVICEINTERFACE dbi = new
- Win32.DEV_BROADCAST_DEVICEINTERFACE();
- int size = Marshal.SizeOf(dbi);
- dbi.dbcc_size = size;
- dbi.dbcc_devicetype = Win32.DBT_DEVTYP_DEVICEINTERFACE;
- dbi.dbcc_reserved = 0;
- dbi.dbcc_classguid = Win32.GUID_DEVINTERFACE_USB_DEVICE;
- dbi.dbcc_name = 0;
- IntPtr buffer = Marshal.AllocHGlobal(size);
- Marshal.StructureToPtr(dbi, buffer, true);
- IntPtr r = Win32.RegisterDeviceNotification(Handle, buffer,
- Win32.DEVICE_NOTIFY_WINDOW_HANDLE);
- if (r == IntPtr.Zero)
- System.Windows.Forms.MessageBox.Show(Win32.GetLastError().ToString());
- }
- #endregion
- #region 获取文件图标
- public const uint SHGFI_ICON = 0x100;
- public const uint SHGFI_LARGEICON = 0x0; // Large icon
- public const uint SHGFI_SMALLICON = 0x1; // Small icon
- /// <summary>
- /// 获取一个图标
- /// </summary>
- /// <param name="pszPath"></param>
- /// <param name="dwFileAttributes"></param>
- /// <param name="psfi"></param>
- /// <param name="cbSizeFileInfo"></param>
- /// <param name="uFlags"></param>
- /// <returns></returns>
- [System.Runtime.InteropServices.DllImport("shell32.dll")]
- public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
- /// <summary>
- /// 销毁一个图标并且释放该图标所占用的内存;
- /// </summary>
- /// <param name="handle"></param>
- /// <returns></returns>
- [System.Runtime.InteropServices.DllImport("user32.dll")]
- public static extern bool DestroyIcon(IntPtr handle);
- /// <summary>
- /// 获取文件图标的Image
- /// </summary>
- /// <param name="fileFullPath"></param>
- /// <returns></returns>
- public static System.Drawing.Image GetFileImage(string fileFullPath)
- {
- System.Drawing.Image fileIconImage = null;
- System.Drawing.IconConverter imageConverter = new System.Drawing.IconConverter();
- System.Drawing.Icon icon = GetFileIcon(fileFullPath);
- try
- {
- if (icon != null)
- {
- fileIconImage = (System.Drawing.Image)
- imageConverter.ConvertTo(icon, typeof(System.Drawing.Image));
- }
- }
- catch (NotSupportedException)
- {
- }
- return fileIconImage;
- }
- /// <summary>
- /// 获取文件图标的Icon
- /// </summary>
- /// <param name="fileFullPath"></param>
- /// <returns></returns>
- public static System.Drawing.Icon GetFileIcon(string fileFullPath)
- {
- string filePath = fileFullPath;
- if (System.IO.File.Exists(filePath))
- {
- System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);
- //
- // Get the File icon
- //
- SHFILEINFO shinfo = new SHFILEINFO();
- IntPtr hImg = Win32.SHGetFileInfo(filePath, 0, ref shinfo,
- (uint)System.Runtime.InteropServices.Marshal.SizeOf(shinfo), Win32.SHGFI_ICON | Win32.SHGFI_SMALLICON);
- if (shinfo.hIcon != null)
- {
- //The icon is returned in the hIcon member of the shinfo struct
- System.Drawing.IconConverter imageConverter = new System.Drawing.IconConverter();
- System.Drawing.Icon icon = System.Drawing.Icon.FromHandle(shinfo.hIcon);
- Win32.DestroyIcon(shinfo.hIcon);
- return icon;
- }
- else
- {
- return null;
- }
- }
- else { return null; }
- }
- #endregion
- /// <summary>
- /// 获取指定驱动容量大小
- /// </summary>
- /// <param name="drive">指定驱动路径</param>
- /// <param name="freeBytes">可用大小字节</param>
- /// <param name="totalBytes">总共容量大小字节</param>
- /// <param name="totalFreeBytes">总共可用大小字节</param>
- /// <returns></returns>
- [DllImport("KERNEL32.DLL ", EntryPoint = "GetDiskFreeSpaceExW", CharSet = CharSet.Unicode,SetLastError = true)]
- public static extern bool GetDiskFreeSpace(string drive, ref long freeBytes, ref long totalBytes, ref long totalFreeBytes);
- [System.Runtime.InteropServices.DllImport("Kernel32.dll")]
- public extern static int FormatMessage(int flag, ref IntPtr source, int msgid, int langid, ref string buf, int size, ref IntPtr args);
- /// <summary>
- /// 获取系统错误信息描述
- /// </summary>
- /// <param name="errCode">系统错误码</param>
- /// <returns></returns>
- public static string GetSysErrMsg(int errCode)
- {
- IntPtr tempptr = IntPtr.Zero;
- string msg = null;
- FormatMessage(0x1300, ref tempptr, errCode, 0, ref msg, 255, ref tempptr);
- return msg;
- }
- }
- [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]
- public struct SHFILEINFO
- {
- public IntPtr hIcon;
- public IntPtr iIcon;
- public uint dwAttributes;
- [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 260)]
- public string szDisplayName;
- [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 80)]
- public string szTypeName;
- }
- /// <summary>
- ///
- /// </summary>
- public struct MyDriverInfo
- {
- private string errorMessages;
- /// <summary>
- /// 错误信息
- /// </summary>
- public string ErrorMessages
- {
- get { return errorMessages; }
- set { errorMessages = value; }
- }
- private string driverPath;
- /// <summary>
- /// 指定驱动路径
- /// </summary>
- public string DriverPath
- {
- get { return driverPath; }
- set { driverPath = value; }
- }
- private long freeBytes;//可用大小
- /// <summary>
- /// 可用大小字节
- /// </summary>
- public long FreeBytes
- {
- get { return freeBytes; }
- set { freeBytes = value; }
- }
- private long totalBytes;//
- /// <summary>
- /// 总共容量大小字节
- /// </summary>
- public long TotalBytes
- {
- get { return totalBytes; }
- set { totalBytes = value; }
- }
- private long totalFreeBytes;
- /// <summary>
- /// 总共可用大小字节
- /// </summary>
- public long TotalFreeBytes
- {
- get { return totalFreeBytes; }
- set { totalFreeBytes = value; }
- }
- /// <summary>
- /// 可用大小 GB
- /// </summary>
- public int G_FreeBytes
- {
- get
- {
- if (freeBytes > 0)
- {
- return Convert.ToInt32(freeBytes / 1024 / 1024 / 1024);
- }
- else
- {
- return 0;
- }
- }
- }
- /// <summary>
- /// 总共容量大小 GB
- /// </summary>
- public int G_TotalBytes
- {
- get
- {
- if (totalBytes > 0)
- {
- return Convert.ToInt32(totalBytes / 1024 / 1024 / 1024);
- }
- else
- {
- return 0;
- }
- }
- }
- /// <summary>
- /// 总共可用大小 GB
- /// </summary>
- public int G_TotalFreeBytes
- {
- get
- {
- if (totalFreeBytes > 0)
- {
- return Convert.ToInt32(totalFreeBytes / 1024 / 1024 / 1024);
- }
- else
- {
- return 0;
- }
- }
- }
- //////////
- /// <summary>
- /// 可用大小 GB
- /// </summary>
- public double GDouble_FreeBytes
- {
- get
- {
- if (freeBytes > 0)
- {
- return Convert.ToDouble(freeBytes / 1024.0 / 1024.0 / 1024.0);
- }
- else
- {
- return 0;
- }
- }
- }
- /// <summary>
- /// 总共容量大小 GB
- /// </summary>
- public double GDouble_TotalBytes
- {
- get
- {
- if (totalBytes > 0)
- {
- return Convert.ToDouble(totalBytes / 1024.0 / 1024.0 / 1024.0);
- }
- else
- {
- return 0;
- }
- }
- }
- /// <summary>
- /// 总共可用大小 GB
- /// </summary>
- public double GDouble_TotalFreeBytes
- {
- get
- {
- if (totalFreeBytes > 0)
- {
- return Convert.ToDouble(totalFreeBytes / 1024.0 / 1024.0 / 1024.0);
- }
- else
- {
- return 0;
- }
- }
- }
- }
- public class Win_X86
- {
- /// <summary>
- /// C++ Dll 生成缩略图
- /// </summary>
- /// <param name="lpImgPath">要生成的原图路径</param>
- /// <param name="lpNewImgPath">生成的缩略图要保存的路径</param>
- /// <param name="dwWidth">缩略图宽</param>
- /// <param name="dwHeight">缩略图高</param>
- /// <param name="dwQuality">0~100 品质 如果为 0 时无法控件品质 但可以使32位系统生成百兆以后相片的缩略图</param>
- /// <returns></returns>
- [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail_x86")]
- public static extern bool GenerationThumbnail(string lpImgPath, string lpNewImgPath, uint dwWidth, uint dwHeight, uint dwQuality);
- /// <summary>
- /// C++ Dll 获取指定图片信息
- /// </summary>
- /// <param name="lpImgPath">要获取的指定的图片信息</param>
- /// <param name="dwWidth">ref 宽</param>
- /// <param name="dwHeight">ref 高</param>
- /// <param name="fHorizontal">ref 水平方向分辨率</param>
- /// <param name="fVertical">ref 垂直方向分辨率</param>
- /// <returns></returns>
- [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail_x86")]
- public static extern bool GetImgInfo(string lpImgPath, ref uint dwWidth, ref uint dwHeight, ref float fHorizontal, ref float fVertical);
- }
- public class Win_X64
- {
- /// <summary>
- /// C++ Dll 生成缩略图
- /// </summary>
- /// <param name="lpImgPath">要生成的原图路径</param>
- /// <param name="lpNewImgPath">生成的缩略图要保存的路径</param>
- /// <param name="dwWidth">缩略图宽</param>
- /// <param name="dwHeight">缩略图高</param>
- /// <param name="dwQuality">0~100 品质 如果为 0 时无法控件品质 但可以使32位系统生成百兆以后相片的缩略图</param>
- /// <returns></returns>
- [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail_x64")]
- public static extern bool GenerationThumbnail(string lpImgPath, string lpNewImgPath, uint dwWidth, uint dwHeight, uint dwQuality);
- /// <summary>
- /// C++ Dll 获取指定图片信息
- /// </summary>
- /// <param name="lpImgPath">要获取的指定的图片信息</param>
- /// <param name="dwWidth">ref 宽</param>
- /// <param name="dwHeight">ref 高</param>
- /// <param name="fHorizontal">ref 水平方向分辨率</param>
- /// <param name="fVertical">ref 垂直方向分辨率</param>
- /// <returns></returns>
- [System.Runtime.InteropServices.DllImport("SimpleImgThumbnail_x64")]
- public static extern bool GetImgInfo(string lpImgPath, ref uint dwWidth, ref uint dwHeight, ref float fHorizontal, ref float fVertical);
- }
- public class VCMD5_X86
- {
- [System.Runtime.InteropServices.DllImport("lyfzMD5_x86.dll")]
- public static extern int GetStringMD5(string lpString, IntPtr pResult, int length);
- [System.Runtime.InteropServices.DllImport("lyfzMD5_x86.dll")]
- public static extern int GetFileMD5(string lpFilepath, IntPtr pResult, int length);
- [System.Runtime.InteropServices.DllImport("lyfzMD5_x86.dll")]
- public static extern int GetByteMD5(IntPtr lpBytes, int nInputlen, IntPtr pResult);
- }
- public class VCMD5_X64
- {
- [System.Runtime.InteropServices.DllImport("lyfzMD5_x64.dll")]
- public static extern int GetStringMD5(string lpString, IntPtr pResult, int length);
- [System.Runtime.InteropServices.DllImport("lyfzMD5_x64.dll")]
- public static extern int GetFileMD5(string lpFilepath, IntPtr pResult, int length);
- [System.Runtime.InteropServices.DllImport("lyfzMD5_x64.dll")]
- public static extern int GetByteMD5(IntPtr lpBytes, int nInputlen, IntPtr pResult);
- }
- }
|