Introduction
This application reads the OS version, the ServicePack and the user's properties out.
Code-Blocks
</FONT><FONT color=#0000ff size=2>Private</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Sub</FONT><FONT size=2> Form1_Load(</FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> System.Object, </FONT><FONT color=#0000ff size=2>ByVal</FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> System.EventArgs) </FONT><FONT color=#0000ff size=2>Handles</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>MyBase</FONT><FONT size=2>.Load
</FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> usid </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> User.Identity
Label1.Text = usid.CurrentUserName
Label2.Text = usid.CurrentMaschineName
Label3.Text = usid.DomainName
Label4.Text = usid.UserIdentityName
Label5.Text = usid.IsAuthenticated
Label6.Text = usid.AuthenticationType
OSVer.Text = Environment.OSVersion.ToString
ReadOS()
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Sub
#</FONT><FONT color=#0000ff size=2>Region</FONT><FONT size=2> "OS"
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> objWMI </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Object
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> colItems </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Object
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> objItem </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Object
</FONT><FONT color=#0000ff size=2>Sub</FONT><FONT size=2> ReadOS()
</FONT><FONT color=#008000 size=2>'Check if WMI is installed
objWMI = GetObject("WinMgmts:")</FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2> Err.Number <> 0 </FONT><FONT color=#0000ff size=2>Then
OSSP.Text = "Kein WMI installiert!"
Err.Clear()
objWMI = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT color=#0000ff size=2>Exit</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Sub
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>If
</FONT><FONT color=#008000 size=2>'create and query WMI-Object
objWMI = GetObject("WinMgmts:/root/cimv2")colItems = objWMI.ExecQuery("SELECT * FROM Win32_OperatingSystem")</FONT><FONT color=#0000ff size=2>For</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Each</FONT><FONT size=2> objItem </FONT><FONT color=#0000ff size=2>In</FONT><FONT size=2> colItems
</FONT><FONT color=#008000 size=2>'Check if it's 'Windows NT', 'Windows 2000' or 'Windows XP'
</FONT><FONT color=#008000 size=2>'All NT-OSs have OSType 18
</FONT><FONT color=#0000ff size=2>If</FONT><FONT size=2> objItem.OSType = 18 </FONT><FONT color=#0000ff size=2>Then</FONT><FONT color=#008000 size=2>
OSSP.Text = objItem.Caption & vbNewLine & objItem.CSDVersion
</FONT><FONT color=#0000ff size=2>Else
OSSP.Text = "The ServicePack can only be accessed for " & " the OSs 'Windows NT, 2000 and XP' "
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>If
</FONT><FONT color=#0000ff size=2>Next</FONT><FONT size=2> objItem
</FONT><FONT color=#008000 size=2>'clear
objItem = </FONT><FONT color=#0000ff size=2>Nothing
colItems = </FONT><FONT color=#0000ff size=2>Nothing
objWMI = </FONT><FONT color=#0000ff size=2>Nothing
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Sub
#</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Region
Imports</FONT><FONT size=2> System.Environment
Imports</FONT><FONT size=2> System.Security.Principal
Namespace</FONT><FONT size=2> User
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Class</FONT><FONT size=2> Identity
</FONT><FONT color=#0000ff size=2>Private</FONT><FONT size=2> m_User </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> WindowsPrincipal(WindowsIdentity.GetCurrent)
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> CurrentUserName() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String
</FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> UserName
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> CurrentMaschineName() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String
</FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> MachineName
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> DomainName() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String
</FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> UserDomainName
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> UserIdentityName() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String
</FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> m_User.Identity.Name
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> IsAuthenticated() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String
</FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> m_User.Identity.IsAuthenticated.ToString
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property
</FONT><FONT color=#0000ff size=2>Public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>ReadOnly</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property</FONT><FONT size=2> AuthenticationType() </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>String
</FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>Return</FONT><FONT size=2> m_User.Identity.AuthenticationType
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Get
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Property
</FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Class
End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Namespace</FONT>
Well that's everything. I won't explain here everything because Basic is an easy readeble
language and some functions tell with their name what they do.