我爱Aspx >> C#.Net >> HOW TO:获取硬盘物理序列号""" <summary>
""" 获取物理序列号
""" </summary>
""" <param name="id">系统硬盘序号,0-255</param>
Public Shared Function GetSerialNumber(ByVal id As Byte) As String
Dim os As OperatingSystem = Environment.OSVersion
If os.Platform <> PlatformID.Win32NT Then
Throw New NotSupportedException("仅支持2000/XP/2003")
End If
If os.Version.Major < 5 Then
Throw New NotSupportedException("仅支持2000/XP/2003")
End If
Return Read(id)
End Function
Private Shared Function Read(ByVal drive As Byte) As String
Dim driveName As String = String.Concat("\\.\PhysicalDrive", drive.ToString())
Dim device As Int32 = CreateFile( _
driveName, _
GENERIC_READ Or GENERIC_WRITE, _
FILE_SHARE_READ Or FILE_SHARE_WRITE, _
0, _
OPEN_EXISTING, _
Ҷƪл˵?
XP最多可以支持多少个扩展监视器..[06-12]
求c#写的工作流引擎源代码[06-12]
JAVA小问题[06-12]
窗口A 打开 窗口B,如何在B 中的..[06-12]
如何为UdpClient设置proxy进行通..[06-12]
freebsd下定期运行java应用程序[06-12]
textBox内的判断,会的请指教[06-12]
串口编程的问题?[06-12]
请问:怎样查看系统中berkeley数..[06-12]
什么时候需要深度复制[06-12]