| 如何获得Windows的启动模式? |
作者:孟宪会 发布日期:2003-07-17 12:24:48
|
可以调用SystemInformation来判断 Windows 启动的模式和用户信息。代码如下:
Dim Label1 As System.Windows.Forms.Label = New System.Windows.Forms.Label()
Label1.Location = New System.Drawing.Point(32, 40)
Label1.Size = New System.Drawing.Size(224, 56)
Me.Controls.AddRange(New Control() {Label1})
Dim str As String = ""
str = System.Windows.Forms.SystemInformation.UserDomainName
str = str + "/" + System.Windows.Forms.SystemInformation.UserName + vbCrLf
Select Case System.Windows.Forms.SystemInformation.BootMode
Case BootMode.FailSafe
Label1.Text = "基本模式启动[安全模式]"
Case BootMode.FailSafeWithNetwork
Label1.Text = "基本模式启动[安全模式](网络功能可用)"
Case BootMode.Normal
Label1.Text = "标准模式启动"
End Select
Label1.Text = str + Label1.Text
|
原文地址:http://dotnet.aspx.cc/article/00000000-0000-0000-0000-000000000006/print.aspx
© 版权所有 【孟宪会之精彩世界】TM 2012