Public Class Bq_PcClass Bq_Pc ''得到本計算機的一些信息
Private lPcIP, lName, lPcName As String
Private lTemp, lSys32, lDesk, lWindir, lTemplates As String
Private lFavorites, lProgramFiles As String
Public Sub New()Sub New()
Try
Dim oEnv As System.Environment
Dim oSpe As Environment.SpecialFolder
Dim myip As System.Net.IPHostEntry
Dim lBqfn As New bqbass.BqFnBass
myip = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)
lName = System.Environment.UserName ''當前用戶名
If Len(lName) = 0 Then
lName = System.Environment.UserDomainName ''當前用戶名
End If
lPcIP = myip.AddressList.GetValue(0).ToString
lPcName = System.Environment.MachineName ''當前機器名
Dim s As String
s = System.Environment.OSVersion.ToString]
lPcName = myip.HostName.ToString
lTemp = lBqfn.BqPathG(System.IO.Path.GetTempPath())
lDesk = lBqfn.BqPathG(oEnv.GetFolderPath(oSpe.DesktopDirectory))
lSys32 = lBqfn.BqPathG(oEnv.GetFolderPath(oSpe.System))
lWindir = lBqfn.BqPathG(oEnv.GetFolderPath(oSpe.MyComputer)) ''????
lTemplates = lBqfn.BqPathG(oEnv.GetFolderPath(oSpe.Templates))
lProgramFiles = lBqfn.BqPathG(oEnv.GetFolderPath(oSpe.ProgramFiles))
lFavorites = lBqfn.BqPathG(oEnv.GetFolderPath(oSpe.Favorites))
Dim k As String = System.Environment.SystemDirectory
Debug.WriteLine(k)
Catch ex As Exception
End Try
''還要得到cpu的號,硬盤的號等
End Sub
Public ReadOnly Property sPcName()Property sPcName() As String ''當前機器名
Get
Return lPcName
End Get
End Property ''當前機器名
Public ReadOnly Property sPcIP()Property sPcIP() As String ''主機IP
Get
Return lPcIP
End Get
End Property ''主機IP
Public ReadOnly Property sUserName()Property sUserName() As String ''當前用戶名
Get
Return lName
End Get
End Property ''當前用戶名
Public ReadOnly Property sSysPathTemp()Property sSysPathTemp() As String
Get
Return lTemp
End Get
End Property
Public ReadOnly Property sSysPathSys32()Property sSysPathSys32() As String
Get
Return lSys32
End Get
End Property
Public ReadOnly Property sSysPathDesk()Property sSysPathDesk() As String
Get
Return lDesk
End Get
End Property
Public ReadOnly Property sSysPathWindir()Property sSysPathWindir() As String
Get
Return lWindir
End Get
End Property
Public ReadOnly Property sSysPathTemplates()Property sSysPathTemplates() As String
Get
Return lTemplates
End Get
End Property
Public ReadOnly Property sSysPathFavorites()Property sSysPathFavorites() As String
Get
Return lFavorites
&nb
sp; End Get
End Property
Public ReadOnly Property sSysPathProgramFiles()Property sSysPathProgramFiles() As String
Get
Return lProgramFiles
End Get
End Property
End Class ''得到本計算機的一些信息