Dit artikel is gepubliceerd op zondag 31 juli 2011 op vbvoorbeelden, bezoek de website voor een recente versie van dit artikel of andere artikels.
Visual Basic 2010 Broncode
Class Example Public Shared Sub Main()
Dim myOS
As System.
OperatingSystem = Environment.OSVersion
Console.WriteLine(
"OS + version : " & myOS.ToString())
Console.WriteLine(
"OS-version : " & myOS.Version.ToString())
Dim myOSPlatform
As System.
PlatformID = myOS.Platform
Console.WriteLine(
"platform : " & myOSPlatform.ToString())
Console.Write(Environment.NewLine())
Dim myRunTime
As System.
Version = Environment.Version
Console.WriteLine(
"runtime : " & myRunTime.ToString())
Console.WriteLine(
"major version : " & myRunTime.Major.ToString())
Console.Write(Environment.NewLine())
Console.WriteLine(
"physical memory : " & _
Environment.WorkingSet.ToString())
Console.Write(Environment.NewLine())
Console.WriteLine(
"NetBIOS name : " & Environment.MachineName)
Console.WriteLine(
"processors : " & _
Environment.ProcessorCount.ToString())
Console.Write(Environment.NewLine())
Console.WriteLine(
"system-directory : " & Environment.SystemDirectory)
Console.WriteLine(
"active-directory : " & Environment.CurrentDirectory)
Console.WriteLine(
"program files : " & _
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles))
Console.WriteLine(
"my documents : " & _
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
Console.Write(Environment.NewLine())
Dim logicalDrives
As String() = Environment.GetLogicalDrives()
For Each logicalDrive
As String In logicalDrives
Console.WriteLine(logicalDrive)
Next Console.Write(Environment.NewLine())
Console.WriteLine(
"username : " & Environment.UserName)
Console.WriteLine(
"userdomainname : " & Environment.UserDomainName)
Console.ReadLine()
End SubEnd ClassConsole Application Output
OS + version : Microsoft Windows NT 6.0.6000.0
OS-version : 6.0.6000.0
platform : Win32NT
runtime : 2.0.50727.1433
major version : 2
physical memory : 20082688
NetBIOS name : HOME
processors : 4
system-directory : C:\Windows\system32
active-directory : D:\Visual Basic\bin\Debug
program files : C:\Program Files
my documents : C:\Users\myUserName\Documents
C:\
D:\
E:\
F:\
username : myUserName
userdomainname : myUserDomain
Dit artikel is gepubliceerd op zondag 31 juli 2011 op vbvoorbeelden, bezoek de website voor een recente versie van dit artikel of andere artikels.