📄 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -