Some features of computer hardware information in. Net
Source: Internet
Author: User
Some features of computer hardware information in. Net
Get the 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 monitor resolution is:" & X & "X" & Y)
Get the path to a special folder
' Desktop ' Desktop folder path
MsgBox (Environment.getfolderpath (Environment.SpecialFolder.DesktopDirectory))
' Favorites ' Favorites Path
MsgBox (Environment.getfolderpath (Environment.SpecialFolder.Favorites))
' Application Data ' path
MsgBox (Environment.getfolderpath (Environment.SpecialFolder.ApplicationData))
' General wording
' 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 user name of the current login
MsgBox (Environment.username)
Get the path to the current application
MsgBox (Environment.currentdirectory)
Turn CD-ROM on and off
' First new module
Module Mciapimodule
Declare Function mcisendstring Lib "Winmm.dll" Alias "Mcisendstringa" _
(ByVal Lpstrcommand As String, ByVal lpstrreturnstring As String, _
ByVal ureturnlength As Integer, ByVal hwndcallback As Integer) As Integer
End 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)
Get computer IP and computer full name
Dim MYIP as System.Net.IPHostEntry = System.Net.Dns.GetHostByName (System.Net.Dns.GetHostName)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.