📄 rasmain.frm
字号:
VERSION 5.00
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"
Begin VB.Form frmRASMAIN
Caption = "RAS高级编程"
ClientHeight = 7095
ClientLeft = 1815
ClientTop = 1875
ClientWidth = 11880
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 7095
ScaleWidth = 11880
Begin VB.CommandButton cmdGetWinVer
Caption = "系统信息"
Height = 375
Left = 10560
TabIndex = 11
Top = 1560
Width = 1335
End
Begin VB.CommandButton cmdRefreshConnTree
Caption = "刷新树视图"
Height = 375
Left = 10560
TabIndex = 10
Top = 1080
Width = 1335
End
Begin VB.CommandButton cmdRemoveConnection
Caption = "删除连接"
Enabled = 0 'False
Height = 375
Left = 10560
TabIndex = 9
Top = 600
Width = 1335
End
Begin VB.CommandButton cmdAddConnection
Caption = "增加连接"
Height = 375
Left = 10560
TabIndex = 8
Top = 120
Width = 1335
End
Begin VB.CheckBox chkDialAsync
Caption = "异步拨号"
Height = 375
Left = 4560
TabIndex = 7
Top = 2520
Width = 1335
End
Begin VB.CommandButton cmdUpdateEntry
Caption = "提交属性"
Enabled = 0 'False
Height = 375
Left = 4560
TabIndex = 6
Top = 1560
Width = 1335
End
Begin VB.CommandButton cmdDialNumber
Caption = "拨号"
Enabled = 0 'False
Height = 375
Left = 4560
TabIndex = 5
Top = 2040
Width = 1335
End
Begin VB.CommandButton cmdAddEntry
Caption = "增加地址簿"
Height = 375
Left = 4560
TabIndex = 4
Top = 600
Width = 1335
End
Begin VB.CommandButton cmdEditEntry
Caption = "编辑地址簿"
Enabled = 0 'False
Height = 375
Left = 4560
TabIndex = 3
Top = 120
Width = 1335
End
Begin VB.CommandButton cmdRefresh
Caption = "刷新树视图"
Height = 375
Left = 4560
TabIndex = 2
Top = 1080
Width = 1335
End
Begin ComctlLib.TreeView trvConnections
Height = 6855
Left = 6120
TabIndex = 1
Top = 120
Width = 4350
_ExtentX = 7673
_ExtentY = 12091
_Version = 327682
Style = 7
Appearance = 1
End
Begin ComctlLib.TreeView trvPhonebook
Height = 6855
Left = 120
TabIndex = 0
TabStop = 0 'False
Top = 120
Width = 4335
_ExtentX = 7646
_ExtentY = 12091
_Version = 327682
Sorted = -1 'True
Style = 7
BorderStyle = 1
Appearance = 1
End
Begin ComctlLib.ImageList imgTreeIcons
Left = 10560
Top = 2280
_ExtentX = 1005
_ExtentY = 1005
BackColor = 16777215
ImageWidth = 16
ImageHeight = 16
MaskColor = 16777215
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 8
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":031A
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":0634
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":094E
Key = ""
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":0C68
Key = ""
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":0F82
Key = ""
EndProperty
BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":129C
Key = ""
EndProperty
BeginProperty ListImage8 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "RASMAIN.frx":15B6
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmRASMAIN"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public objRASEng As RASEngine
Private Sub cmdAddConnection_Click()
Dim boolSuccess As Boolean
'弹出frmCreateConn对话框
frmCreateConn.Show 1
'刷新连接树视图
boolSuccess = fcnRefreshConnectionTree()
End Sub
Private Sub cmdAddEntry_Click()
'增加电话簿
On Error GoTo errhand
'通过类RASEngine来增加电话簿
objRASEng.PhoneEntries.AddEntry
boolSuccess = fcnRefreshPhonebookTree()
On Error GoTo 0
Exit Sub
errhand:
Call fcnErrorHandler
Resume Next
End Sub
Private Sub cmdDialNumber_Click()
'该事件拨号
Dim boolSuccess As Boolean
Dim intTempIndex As Integer
Dim objRASConn As Connection
On Error GoTo errhand
'至于拨号的内部细节请参看各个类的具体描述
intTempIndex = CInt(Val(Right$(trvPhonebook.SelectedItem.Key, Len(trvPhonebook.SelectedItem.Key) - 3)))
Set objRASConn = objRASEng.PhoneEntries(CVar(intTempIndex)).DialEntry(chkDialAsync.Value)
boolSuccess = fcnRefreshConnectionTree()
On Error GoTo 0
Exit Sub
errhand:
Call fcnErrorHandler
Resume Next
End Sub
Private Sub cmdEditEntry_Click()
'编辑电话簿
Dim boolSuccess As Boolean
Dim intTempIndex As Integer
On Error GoTo errhand
intTempIndex = CInt(Val(Right$(trvPhonebook.SelectedItem.Key, Len(trvPhonebook.SelectedItem.Key) - 3)))
objRASEng.PhoneEntries(CVar(intTempIndex)).EditEntry
'在树视图中,打开当前要编辑的电话簿
trvPhonebook.SelectedItem.Text = objRASEng.PhoneEntries(CVar(intTempIndex)).EditEntry
On Error GoTo 0
Exit Sub
errhand:
Call fcnErrorHandler
Exit Sub
End Sub
Private Sub cmdGetWinVer_Click()
'得到操作系统信息
Select Case objRASEng.OSType
Case 2 'VER_PLATFORM_WIN32_NT
MsgBox "Running: Windows NT" & vbCrLf & "Version: " & Str$(objRASEng.OSVersion) & vbCrLf & "Build: " & Str$(objRASEng.OSBuildNumber), , "Operating System Information"
Case 1 'VER_PLATFORM_WIN32_WINDOWS
MsgBox "Running: Windows 95" & vbCrLf & "Version: " & Str$(objRASEng.OSVersion) & vbCrLf & "Build: " & Str$(objRASEng.OSBuildNumber), , "Operating System Information"
Case 0 'VER_PLATFORM_WIN32s
MsgBox "Running: Windows 3.1 with WIN32s" & vbCrLf & "Version: " & Str$(objRASEng.OSVersion) & vbCrLf & "Build: " & Str$(objRASEng.OSBuildNumber), vbCritical, "Warning: Not A Supported OS"
Case Else '其他未知操作系统
MsgBox "Running: Unknown OS" & vbCrLf & "Version: " & Str$(objRASEng.OSVersion) & vbCrLf & "Build: " & Str$(objRASEng.OSBuildNumber), vbCritical, "Warning: Not A Supported OS"
End Select
End Sub
Private Sub cmdRefresh_Click()
Dim boolSuccess As Boolean
'刷新树视图
On Error GoTo errhand
boolSuccess = fcnRefreshPhonebookTree()
On Error GoTo 0
Exit Sub
errhand:
Call fcnErrorHandler
Resume Next
End Sub
Private Sub cmdRefreshConnTree_Click()
Dim boolSuccess As Boolean
'刷新连接视图,通过函数fcnRefreshConnectionTree
On Error GoTo errhand
boolSuccess = fcnRefreshConnectionTree()
On Error GoTo 0
Exit Sub
errhand:
Call fcnErrorHandler
Resume Next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -