/[cvs]/joko/ToolBox/Windows/VpnDial/src/Module_Main.bas
ViewVC logotype

Diff of /joko/ToolBox/Windows/VpnDial/src/Module_Main.bas

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by joko, Sun Oct 9 18:42:25 2005 UTC revision 1.9 by joko, Tue Nov 22 22:20:11 2005 UTC
# Line 52  Sub Main() Line 52  Sub Main()
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)
# Line 141  Sub Main() Line 120  Sub Main()
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
# Line 173  Private Sub ReadRasEntries() Line 170  Private Sub ReadRasEntries()
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
# Line 243  Private Function getTrayIconTipText(conN Line 240  Private Function getTrayIconTipText(conN
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

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed