52 |
' Form_Main.Show |
' Form_Main.Show |
53 |
'Else |
'Else |
54 |
|
|
|
' dial command |
|
|
If cmdline.hasSwitch("dial") Then |
|
|
|
|
|
conName = cmdline.getArgument("dial") |
|
|
On Error Resume Next |
|
|
Set rasItem = RasEntries(conName) |
|
|
If Err.Number = 0 Then |
|
|
success = RasConnect(rasItem.entryname, rasItem.PhonebookPath) |
|
|
Else |
|
|
MsgBox "Unkown RAS-Connection """ & conName & """." |
|
|
End If |
|
|
On Error GoTo 0 |
|
|
|
|
|
' hangup command |
|
|
ElseIf cmdline.hasSwitch("hangup") Then |
|
|
conName = cmdline.getArgument("hangup") |
|
|
success = RasDisconnect(conName) |
|
|
'MsgBox success |
|
|
|
|
|
'End If |
|
|
|
|
55 |
' run script |
' run script |
56 |
ElseIf cmdline.hasSwitch("script") And success = True Then |
If cmdline.hasSwitch("script") And success = True Then |
57 |
script_name = cmdline.getArgument("script") |
script_name = cmdline.getArgument("script") |
58 |
If script_name <> "" Then |
If script_name <> "" Then |
59 |
script_args = Chr(34) & DetermineClientIP(conName) & Chr(34) & " " & Chr(34) & DetermineServerIP(conName) & Chr(34) |
script_args = Chr(34) & DetermineClientIP(conName) & Chr(34) & " " & Chr(34) & DetermineServerIP(conName) & Chr(34) |
120 |
ShowTrayIcon Form_Main, getTrayIconTipText(ConnectionName, ConnectionOnline) |
ShowTrayIcon Form_Main, getTrayIconTipText(ConnectionName, ConnectionOnline) |
121 |
End If |
End If |
122 |
|
|
123 |
|
' dial command |
124 |
|
If cmdline.hasSwitch("dial") Then |
125 |
|
doDial conName |
126 |
|
End If |
127 |
|
|
128 |
|
' monitor ras connection |
129 |
MonitorRASStatusAsync |
MonitorRASStatusAsync |
130 |
|
|
131 |
End If |
End If |
132 |
|
|
133 |
|
' dial command |
134 |
|
ElseIf cmdline.hasSwitch("dial") Then |
135 |
|
conName = cmdline.getArgument("dial") |
136 |
|
doDial conName |
137 |
|
|
138 |
|
' hangup command |
139 |
|
ElseIf cmdline.hasSwitch("hangup") Then |
140 |
|
conName = cmdline.getArgument("hangup") |
141 |
|
success = RasDisconnect(conName) |
142 |
|
'MsgBox success |
143 |
|
|
144 |
End If |
End If |
145 |
|
|
146 |
'End If |
'End If |
170 |
On Error Resume Next |
On Error Resume Next |
171 |
RasEntries.add rasItem, rasItem.entryname |
RasEntries.add rasItem, rasItem.entryname |
172 |
If Err.Number = 457 Then |
If Err.Number = 457 Then |
173 |
MsgBox "Error: Duplicate RAS entry. Don't know what to dial. This error should not occour." |
'MsgBox "Error: Duplicate RAS entry. Don't know what to dial. This error should not occour." |
174 |
End If |
End If |
175 |
On Error GoTo 0 |
On Error GoTo 0 |
176 |
Next i |
Next i |
240 |
End If |
End If |
241 |
getTrayIconTipText = TipText |
getTrayIconTipText = TipText |
242 |
End Function |
End Function |
243 |
|
|
244 |
|
|
245 |
|
Private Function doDial(conName As String) |
246 |
|
|
247 |
|
Dim rasItem As RasEntryData |
248 |
|
Dim success As Boolean |
249 |
|
|
250 |
|
On Error Resume Next |
251 |
|
Set rasItem = RasEntries(conName) |
252 |
|
If Err.Number = 0 Then |
253 |
|
success = RasConnect(rasItem.entryname, rasItem.PhonebookPath) |
254 |
|
Else |
255 |
|
MsgBox "Unknown RAS-Connection """ & conName & """." |
256 |
|
End If |
257 |
|
On Error GoTo 0 |
258 |
|
|
259 |
|
End Function |