软件注册码方面的应用和本地化的加密
点击次数:68 次 发布日期:2008-11-06 08:06:44 作者:源代码网
|
源代码网推荐using System.IO; 源代码网推荐using System.Runtime.InteropServices; 源代码网推荐using System.Text; 源代码网推荐using Microsoft.Win32; 源代码网推荐 源代码网推荐namespace Wjb.ReadOrWriteIniAndReg 源代码网推荐{ 源代码网推荐 /// <summary> 源代码网推荐 /// HardDiskVal 的摘要说明。 源代码网推荐 /// 读取指定盘符的硬盘序列号 源代码网推荐 /// 类库开发:吴剑冰 源代码网推荐 /// 时间:2003年10月20日 源代码网推荐 /// 功能:读取指定盘符的硬盘序列号 源代码网推荐 /// </summary> 源代码网推荐 public class HardDiskVal 源代码网推荐 { 源代码网推荐 [DllImport("kernel32.dll")] 源代码网推荐 private static extern int GetVolumeInformation( 源代码网推荐 string lpRootPathName, 源代码网推荐 string lpVolumeNameBuffer, 源代码网推荐 int nVolumeNameSize, 源代码网推荐 ref int lpVolumeSerialNumber, 源代码网推荐 int lpMaximumComponentLength, 源代码网推荐 int lpFileSystemFlags, 源代码网推荐 string lpFileSystemNameBuffer, 源代码网推荐 int nFileSystemNameSize 源代码网推荐 ); 源代码网推荐 /// <summary> 源代码网推荐 /// 获得盘符为drvID的硬盘序列号,缺省为C 源代码网推荐 /// </summary> 源代码网推荐 /// <param name="drvID"></param> 源代码网推荐 /// <returns></returns> 源代码网推荐 public string HDVal(string drvID) 源代码网推荐 { 源代码网推荐 const int MAX_FILENAME_LEN = 256; 源代码网推荐 int retVal = 0; 源代码网推荐 int a =0; 源代码网推荐 int b =0; 源代码网推荐 string str1 = null; 源代码网推荐 string str2 = null; 源代码网推荐 源代码网推荐 int i = GetVolumeInformation( 源代码网推荐 drvID @":", 源代码网推荐 str1, 源代码网推荐 MAX_FILENAME_LEN, 源代码网推荐 ref retVal, 源代码网推荐 a, 源代码网推荐 b, 源代码网推荐 str2, 源代码网推荐 MAX_FILENAME_LEN 源代码网推荐 ); 源代码网推荐 源代码网推荐 return retVal.ToString(); 源代码网推荐 } 源代码网推荐 public string HDVal() 源代码网推荐 { 源代码网推荐 const int MAX_FILENAME_LEN = 256; 源代码网推荐 int retVal = 0; 源代码网推荐 int a =0; 源代码网推荐 int b =0; 源代码网推荐 string str1 = null; 源代码网推荐 string str2 = null; 源代码网推荐 源代码网推荐 int i = GetVolumeInformation( 源代码网推荐 "c:\", 源代码网推荐 str1, 源代码网推荐 MAX_FILENAME_LEN, 源代码网推荐 ref retVal, 源代码网推荐 a, 源代码网推荐 b, 源代码网推荐 str2, 源代码网推荐 MAX_FILENAME_LEN 源代码网推荐 ); 源代码网推荐 源代码网推荐 return retVal.ToString(); 源代码网推荐 } 源代码网推荐 } 源代码网推荐} 源代码网推荐 源代码网推荐 源代码网供稿. |
