得到本计算机的一些信息

5 篇文章 0 订阅

Public   Class Bq_Pc   '得到本计算机的一些信息
    Private lPcIP, lName, lPcName As String
    
Private lTemp, lSys32, lDesk, lWindir, lTemplates As String
    
Private lFavorites, lProgramFiles As String

    
Public 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() As String        '当前机器名 
        Get
            
Return lPcName
        
End Get
    
End Property
   '当前机器名 
    Public ReadOnly Property sPcIP() As String        '主机IP
        Get
            
Return lPcIP
        
End Get
    
End Property
     '主机IP
    Public ReadOnly Property sUserName() As String      '当前用户名 
        Get
            
Return lName
        
End Get
    
End Property
 '当前用户名 
    Public ReadOnly Property sSysPathTemp() As String
        
Get
            
Return lTemp
        
End Get
    
End Property

    
Public ReadOnly Property sSysPathSys32() As String
        
Get
            
Return lSys32
        
End Get
    
End Property

    
Public ReadOnly Property sSysPathDesk() As String
        
Get
            
Return lDesk
        
End Get
    
End Property

    
Public ReadOnly Property sSysPathWindir() As String
        
Get
            
Return lWindir
        
End Get
    
End Property

    
Public ReadOnly Property sSysPathTemplates() As String
        
Get
            
Return lTemplates
        
End Get
    
End Property

    
Public ReadOnly Property sSysPathFavorites() As String
        
Get
            
Return lFavorites
        
End Get
    
End Property

    
Public ReadOnly Property sSysPathProgramFiles() As String
        
Get
            
Return lProgramFiles
        
End Get
    
End Property

End Class
  ' 得到本计算机的一些信息
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值