Author: Meng will come from: [Meng] will be the best of the world
?
Get display resolution
DIM
X
AS
Short
=
System.windows.Forms.Screen.primaryScreen.bounds.width
DIM
Y
AS
Short
=
System.windows.Forms.Screen.primaryScreen.Bounds.Height
Msgbox
(
"
Your display resolution is:
"
&
X
&
"
X
"
&
Y)
Get the path to the special folder
'
"Desktop" desktop folder path
Msgbox
(Environment.GetFolderPath (Environment.SpecialFolder.DesktOpdirectory))
'
Favorites favorite path
Msgbox
(Environment.GetFolderPath (Environment.SpecialFolder.favorites))
'
"Application Data" path
Msgbox
(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData))
'
Universal writing
'
DIM SPEC AS STRING = Environment.GetFolderPath (Environment.SpecialFolder.xxxxxxx)
'
XXXXXXX is the name of a special folder
Get operating system version information
Msgbox
(Environment.OSversion.toString)
Get the current login username
Msgbox
(Environment.Username) Get the path to the current application
Msgbox
(Environment.currentDirectory)
Open and close CD
-
ROM
'
New module first
Module McIapimodule
Module mciAPIModule Declare Function mciSendString () Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" _ (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _ ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As IntegerEnd Module
'
Open CD-ROM
DIM
Lret
AS
Long
Lret
=
McISendstring
"
Set cdaudio door open
"
,
0
&
,
0
,
0
)
'
Turn off CD-ROM
DIM
Lret
AS
Long
Lret
=
McISendstring
"
Set cdaudio door closed
"
,
0
&
,
0
,
0
)
'
For more details, please see
HTTP:
//msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/mmcmdstr_8eyc.asp
Get full names of computer IP and computers
DIM
MYIP
AS
System.net.iphostentry
=
System.net.dns.gethostbyName (System.Net.dns.getHostName) MSGBOX
(
"
Your IP address:
"
&
(Myip.addressList.getValue
0
) .ToString))
Msgbox
(
"
Your computer full name:
"
&
(Myip.hostname.tostring)) Use Win32_Operatingsystem (WMI
Class)
Class) computer information obtained 'in Form1_Load added ListBox incident, and reference system.ManagmentDim opSearch As New ManagementObjectSearcher ( "SELECT * FROM Win32_OperatingSystem") Dim opInfo As ManagementObjectFor Each opInfo In opSearch.Get () ListBox1.Items.Add ( "Name : "& Opinfo (" name "). Tostring ()) Listbox1.items.Add (" Version: "& opinfo (" Version "). Tostring ()) ListBox1.Items.Add (" Manufacturer: "& opinfo (" Manufacturer "). Tostring ()) ListBox1.Items.Add (" CSName "). Tostring ()) ListBox1.Items.Add (" Windows Directory: "& opinfo (" WindowsDirectory). Tostring ())
List all the fonts installed by the computer and add to ListBox
'
New Form and add Listbox and Button
Private
Sub button1_click ()
Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim fntCollection As InstalledFontCollection = New InstalledFontCollection () Dim fntFamily () As FontFamilyfntFamily = fntCollection.FamiliesListBox1.Items.Clear () Dim i As Integer = 0for i = 0 TO FNTFAMILY.LENGTH - 1 ListBox1.Items.Add (FNTFamily (i) .name) Nextend Sub
Use Win32_Processor to list the information of the processor
Imports
System.Management
Public
Class Form1
Class Form1 Inherits System.Windows.Forms.Form # Region "Windows Form Designer Generated Code" Public Sub New () Sub New () MyBase.new () 'This call is required for the Windows Form Designer. InitializationComponent () 'Add any initialized End Sub' form to clean up the component list after the initializeComponent () call. Protected Overloads Overrides Sub Dispose () Sub Dispose (ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose () End If End If MyBase.Dispose (disposing) End Sub 'Windows Form Designer Required Private Components as System.comPonentModel.icontainer 'Note: The following procedure is necessary to use the Windows Form Designer to modify this process using the Windows Form Designer. 'Don't modify it using the code editor.
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox Friend WithEvents Button1 As System.Windows.Forms.Button
"). Tostring ()) Listbox1.items.add (" Architecture: "). Tostring ()) Call processORTYPE (Procinfo (" Processortype "). Tostring ()) Call CPustat (procinfo" ")"). TOSTRING) ListBox1.Items.add ("maxclockspeed:"). Tostring () & "mhz") listbox1.items.add ("l2cachespeed:"). Tostring () & "MHz") ListBox1.Items.Add ("ExtClock:" & Procinfo ("l2cachespeed"). Tostring () & "MHz") listbox1.items.add ("Processorid:" & procinfo ("Processorid" ) .Tostring ()) Listbox1.items.Add ("AddressWidth:"). Tostring () & "bits") listbox1.items.add ("DataWidth:" & procinfo ("DataWidth"). Tostring () & "bits") listbox1.items.add ("Version:" & procinfo ("version"). Tostring ()) Listbox1.Items.Add ("ExtClock:" & procinfo ("extclock"). Tostring ) & "Mhz") Next End Sub Function ProcessorFamily () Function ProcessorFamily (Byval Procssfam) DIM Processtype Select Case Proc ssfam Case 1 processtype = "Other" Case 2 processtype = "Unknown" Case 3 processtype = "8086" Case 4 processtype = "80286" Case 5 processtype = "80386" Case 6 processtype = "80486" Case 7 processtype = "8087" Case 8 Processtype = "80287" Case 9 Processtype = "
80387 "Case 10 processtype =" 80487 "Case 11 processtype =" Pentium brand "Case 12 processtype =" Pentium Pro "Case 13 processtype =" Pentium II "Case 14 processtype =" Pentium processor with MMX technology "Case 15 processtype =" Celeron "Case 16 processtype =" Pentium II Xeon "Case 17 processtype =" Pentium III "Case 18 processtype =" M1 Family "Case 19 processtype =" M2 Family "Case 24 processtype =" K5 Family "Case 25 processtype =" K6 Family " Case 26 processtype = "K6-2" Case 27 processtype = "K6-3" Case 28 processtype = "AMD Athlon Processor Family" Case 29 processtype = "AMD Duron Processor" Case 30 processtype = "AMD2900 Family" Case 31 processtype = " K6-2 "Case 32 Processtype =" Power PC Family "Case 33 Processtype =" PO WER PC 601 "Case 34 Processtype =" Power PC 603 "Case 35 Processtype =" Power PC 603 "Case 36 Processtype =" Power PC 604 "Case 37 ProcesSstype =" Power PC 620 "Case 38 Processtype =" Power PC X704 " Case 39 ProcesStype = "Power PC 750" Case 48 Processtype = "Alpha Family" Case 49 Processtype = "
Alpha 21064 "Case 50 processtype =" Alpha 21066 "Case 51 processtype =" Alpha 21164 "Case 52 processtype =" Alpha 21164PC "Case 53 processtype =" Alpha 21164a "Case 54 processtype =" Alpha 21264 "Case 55 processtype =" Alpha 21364 "Case 64 processtype =" MIPS Family "Case 65 processtype =" MIPS R4000 "Case 66 processtype =" MIPS R4200 "Case 67 processtype =" MIPS R4400 "Case 68 processtype =" MIPS R4600 "Case 69 processtype =" MIPS R10000 "Case 80 processtype = "SPARC Family" Case 81 processtype = "SuperSPARC" Case 82 processtype = "microSPARC II" Case 83 processtype = "microSPARC IIep" Case 84 processtype = "UltraSPARC" Case 85 processtype = "UltraSPARC II" Case 86 processtype = " Ultrasparc III "Case 87 Processtype =" Ultrasparc III "Case 88 processtype =" UltraSPARC IIIi "Case 96 processtype =" 68040 "Case 97 processtype =" 68xxx Family "Case 98 processtype =" 68000 "Case 99 processtype =" 68010 "Case 100 processtype =" 68020 "Case 101 processtype = "68030" Case 112 Processtype = "Hobbit Family"
Case 120 processtype = "Crusoe TM5000 Family" Case 121 processtype = "Crusoe TM3000 Family" Case 128 processtype = "Weitek" Case 130 processtype = "Itanium Processor" Case 144 processtype = "PA-RISC Family" Case 145 processtype = "PA- RISC 8500 "Case 146 Processtype =" PA-RISC 8000 "Case 147 Processtype =" PA-RISC 7300LC "Case 148 Processtype =" PA-RISC 7200 "CASE 149 Processtype =" PA-RISC 7100LC "Case 150 Processtype =" PA- RISC 7100 "Case 160 processtype =" V30 Family "Case 176 processtype =" Pentium III Xeon "Case 177 processtype =" Pentium III Processor with Intel SpeedStep Technology "Case 178 processtype =" Pentium 4 "Case 179 processtype =" Intel Xeon "Case 180 Processtype = "as400 family" case 181 processtype = "Intel Xeon Processor MP" Case 182 processtype = "AMD AthlonXP Family" Case 183 processtype = "AMD AthlonMP Family" Case 184 processtype = "Intel Itanium 2" Case 185 processtype = "AMD Opteron Family" Case 190 processtype = "K7" Case 200 processtype = "IBM390 Family" Case 201 processtype = "g4" case 202 processtype = "g5" case 250 processtype = "
i860 "Case 251 processtype =" i960 "Case 260 processtype =" SH-3 "Case 261 processtype =" SH-4 "Case 280 processtype =" ARM "Case 281 processtype =" StrongARM "Case 300 processtype =" 6x86 "Case 301 processtype = "MediaGX" Case 302 processtype = "MII" Case 320 processtype = "WinChip" Case 350 processtype = "DSP" Case 500 processtype = "Video Processor" End Select ListBox1.Items.Add ( "Family:" & processtype) End Function Function cpuStat () Function cpuStat (ByVal CpuStNUM) Dim stat Select Case CpuStNUM Case 0 stat = "Unknown" Case 1 stat = "CPU Enabled" Case 2 stat = "CPU Disabled by User via BIOS Setup" Case 3 stat = "CPU Disabled by bios (post error) "case 4 stat =" cpu is idle "case 5 stat =" reserved "case 6 stat =" reserved "case 7 stat = "Other" End Select ListBox1.Items.Add ( "CpuStatus:" & stat) End Function Function processortype () Function processortype (ByVal proctypenum) Dim proctype Select Case proctypenum Case 1 proctype = "Other" Case 2 proctype = "Unknown "Case 3 ProctyPe =" CAntral Processor "case 4 proctype =" math processor "case 5 procty =" DSP processor "
Case 6 proctype = "Video processor" end select listbox1.items.add ("Processor Type:" & procty) End Functionend Class gets a CD
-
ROM information
Imports
System.Management
Public
Class Form1
Class Form1 Inherits System.Windows.Forms.Form # Region "Windows Form Designer Generated Code" Public Sub New () Sub New () MyBase.new () 'This call is required for the Windows Form Designer. InitializationComponent () 'Add any initialized End Sub' form to clean up the component list after the initializeComponent () call. Protected Overloads Overrides Sub Dispose () Sub Dispose (ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose () End If End If MyBase.Dispose (disposing) End Sub 'Windows Form Designer Required 'Note: The following procedure is required by the Windows Form Designer' You can modify this process using the Windows Form Designer. 'Don't modify it using the code editor.
Private components As System.ComponentModel.IContainer Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
) .Tostring ()) Listbox1.items.add ("CD-ROM Media Loaded:" & SoundDeviceInfo ("MediaLoaded"). Tostring ()) ListBox1.Items.Add ("CD-ROM Media Type:" & SoundDeviceInfo "). Tostring ()) Listbox1.items.add (" CD-ROM Volume Name: "& SoundDeviceInfo (" Volumename "). Tostring ()) ListBox1.Items.Add (" CD-ROM Size: "& SizeInMBS & "Mbytes") listbox1.items.add ("CD-ROM Status:" & SoundDeviceInfo ("status"). TOSTRING ()) listbox1.items.add ("CD-ROM Maxmediasize:" & SoundDeviceInfo ("Maxmediasize). Tostring ()) ListBox1.items.Add ("CD-ROM ID:" & SoundDeviceInfo ("ID"). TOSTRING ()) ListBox1.Items.Add ("CD-ROM Transferrate:" Int (SoundDeviceInfo ("TransforRrate" ) .Tostring ()) "KBS / Second") Next End Subend Class gets hard disk information
Imports
System.Management
Public
Class Form1
Class Form1 Inherits System.Windows.Forms.Form # Region "Windows Form Designer generated code" Public Sub New () Sub New () MyBase.New () InitializeComponent () End Sub Protected Overloads Overrides Sub Dispose () Sub Dispose (ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose () End If End If MyBase.Dispose (disposing) End Sub Private components As System.ComponentModel.IContainer Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
) .ToString ()) ListBox1.Items.Add ( "HDD BytesPerSector:" & HDDDeviceInfo ( "BytesPerSector") ToString ()) ListBox1.Items.Add ( "HDD CompressionMethod:".. & HDDDeviceInfo ( "CompressionMethod") ToString ( )) ListBox1.Items.Add ("HDD INDEX:" & HDDDeviceInfo ("index"). TOSTRING ()) Listbox1.Items.Add ("HDD INSTALDATE:" & HDDEviceInfo ("installdate"). Tostring ()) ListBox1. Items.add ("HDD Manufacturer:" & HDDDeviceInfo ("Manufacturer"). Tostring ()) ListBox1.Items.Add ("HDD Partitions:" & HDDEviceInfo ("partitions"). Tostring ()) ListBox1.Items.add ( "HDD SIZE:" & INT (Val (HDDDeviceInfo ("Size"). Tostring ()) / 2 ^ 30) & "gbytes") listbox1.items.add ("HDD Totalcylinders:" & HDDDeviceInfo ("Totalcylinders"). ToString ()) ListBox1.Items.Add ( "HDD TotalSectors:" & HDDDeviceInfo ( "TotalSectors") ToString ()) ListBox1.Items.Add ( "HDD TracksPerCylinder:" & HDDDeviceInfo ( "TracksPerCylinder").. ToString ()) Listbox1.items.add ("HDD Totalheads:" & HDDDeviceInfo ("Totalheads") .Tostring ()) Listbox1.items.add ("HDD Totaltracks:" & HDDDeviceInfo ("TOTALTRACKS"). TOSTRING ()) ListBox1.Items.Add ("HDD SectRack:" & HDDDeviceInfo ("SectRack"). Tostring () ListBox1.items.Add ("HDD SCSILogicalUnit:" & HDDDeviceInfo ("ScsilogicalUnit"). TOSTRING ()) Next End Subend Class gets the sound card information
Imports
System.Management
Public
Class Form1
Class Form1 Inherits System.Windows.Forms.Form # Region "Windows Form Designer generated code" Public Sub New () Sub New () MyBase.New () InitializeComponent () End Sub Protected Overloads Overrides Sub Dispose () Sub Dispose (ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose () End If End If MyBase.Dispose (disposing) End Sub Private components As System.ComponentModel.IContainer Friend WithEvents ListBox1 As System.Windows.Forms.ListBox