vb.net获取系统信息的方法
写程序的时候,有时需要获取一些系统的信息资料,下面列出方法:
获取此本地计算机的名称:
MsgBox (Environment.MachineName)
获取操作系统版本:
MsgBox(Val(Environment.OSVersion.Version.ToString))
获取操作系统名称及版本:
MsgBox(Environment.OSVersion.ToString)
获取操作系统目录:
MsgBox(Environment.SystemDirectory)
获取系统启动后经过的时间:
MsgBox(“系统已经启动了:” & CStr(Environment.TickCount / 1000) & “秒”)
获取系统收藏夹的目录:
MsgBox(“我的收藏夹:” & Environment.GetFolderPath(Environment.SpecialFolder.Favorites))
获取系统当前用户名:
MsgBox(Environment.UserName)
获取当前显示分辨率:
MsgBox(“主显示器的尺寸为:” & SystemInformation.PrimaryMonitorSize.Width & “*” & SystemInformation.PrimaryMonitorSize.Height & “像素”)