www.pudn.com > source.rar > modUnixInfo.bas


Attribute VB_Name = "modUnixInfo" 
Public strIP As String         'UNIX主机IP地址 
Public strUserName As String   '登录用户名 
Public strPassword As String   '登录密码 
'--------------------- 
Public Const InfoFile = "\sys.dat" 
 
'===========| 获取UNIX主机信息 |========== 
Public Function GetUnixInfo() As Boolean 
Dim lngF As Long 
lngF = FreeFile 
On Error GoTo GET_ERR 
Open App.Path + InfoFile For Input Access Read As #lngF 
Input #lngF, strIP 
Input #lngF, strUserName 
Input #lngF, strPassword 
Close #lngF 
GetUnixInfo = True 
Exit Function 
GET_ERR: 
GetUnixInfo = False 
End Function 
'===========| 设置UNIX主机信息 |========== 
Public Sub SetUnixInfo() 
Dim lngF As Long 
lngF = FreeFile 
On Error GoTo SET_ERR 
Open App.Path + InfoFile For Output Access Write As #lngF 
Print #lngF, strIP 
Print #lngF, strUserName 
Print #lngF, strPassword 
Close #lngF 
Exit Sub 
SET_ERR: 
    MsgBox "写入UNIX信息文件错!", 16 
End Sub 
 
'===========| UNIX主机信息变量初始化 |========== 
Public Sub InitUnixInfo() 
strIP = "" 
strUserName = "" 
strPassword = "" 
End Sub