引用:http://ryan-tw.blogspot.tw/2010/09/if-my.html
'網絡狀況
If My.Computer.Network.Ping("172.18.48.215") Then
Label2.Text = "暢通"
Else
Label2.Text = "不通"
End If
'機器名稱
Label3.Text = Environment.MachineName
'OS名稱
Label5.Text = My.Computer.Info.OSFullName
'Symantec病毒碼日期
Label10.Text = Microsoft.VisualBasic.Left(Microsoft.VisualBasic.Right(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Symantec\SharedDefs", "DEFWATCH_10", Nothing), 12), 8)
'Inter Explorer版本
Label11.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer", "Version", Nothing)
'CPU
Label12.Text = Microsoft.VisualBasic.Trim(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0", "ProcessorNameString", Nothing))
'主板
Label14.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System", "SystemBiosVersion", Nothing).ToString
'鼠標
Label16.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\5\PointerController\0\PointerPeripheral\0", "Identifier", Nothing)
'顯卡
Label21.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000", "DriverDesc", Nothing)
'登入人員
Label23.Text = Environment.UserName
'Broker是自動分配還是手工分配
Label26.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\OOERP\Broker", "Enabled", Nothing).ToString
'總內存
Label28.Text = Str(My.Computer.Info.TotalPhysicalMemory / 1000000) & "M"
'emax.exe版本
Label29.Text = My.Computer.FileSystem.GetFileInfo("C:\emax\application\emax.exe").LastWriteTime.ToString
'broker server
Label30.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\OOERP\AutoUpdateParams", "IP", Nothing).ToString
'OS ServicePack
Label33.Text = Environment.OSVersion.ServicePack.ToString
'系統時間
Label35.Text = My.Computer.Clock.LocalTime.ToString
'C空間和剩餘空間
Label36.Text = "C:盤總空間:" & Int(My.Computer.FileSystem.GetDriveInfo("C:").TotalSize / 1000 / 1000 / 1000) & "G" & " 可用空間:" & Int(My.Computer.FileSystem.GetDriveInfo("C:").TotalFreeSpace / 1000 / 1000 / 1000) & "G"
Label37.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\OOERP\CodePage", "TRANSFERTABLEPATH", Nothing).ToString
Label38.Text = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\OOERP\Broker", "IP", Nothing).ToString
1.電腦名稱:
Environment.MachineName
2.ip地址:
System.Net.Dns.GetHostAddresses()
3.mac地址:
System.Net.NetworkInformation.NetworkInterface.GetPhysicalAddress()
4.ie版本:
使用 FileVersionInfo.GetVersionInfo() 傳入 IE 的執行檔路徑,取得 FileVersionInfo 物件 .
5.os類別版本:
Environment.OSVersion
6.某個文件特定修改日期:
File.GetLastWriteTime()
7.cpu大小型號:
用 Windows API...
8.內存大小型號:
內存是什麼?記憶體嗎?記憶體可用:My.ComputerInfo.TotalPhysicalMemory
型號,可能要用 Windows API 了,或者可參考 DDK 有沒有,內建函式庫應該沒有 .
9.硬盤容量:
Microsoft.VisualBasic.FileIO.FileSystem.GetDriveInfo() 取得 DriveInfo,再用 TotalSize 取得
10.主板型號:
要用 Windows API ,或者可參考 DDK 有沒有,內建函式庫應該沒有 .