1 |
VERSION 5.00 |
2 |
Begin VB.Form Form_Main |
3 |
Caption = "VpnDial" |
4 |
ClientHeight = 3525 |
5 |
ClientLeft = 60 |
6 |
ClientTop = 345 |
7 |
ClientWidth = 6450 |
8 |
LinkTopic = "Form1" |
9 |
ScaleHeight = 3525 |
10 |
ScaleWidth = 6450 |
11 |
StartUpPosition = 3 'Windows Default |
12 |
Begin VB.CommandButton Command_RunScript |
13 |
Caption = "&Run Script" |
14 |
Height = 345 |
15 |
Left = 4770 |
16 |
TabIndex = 4 |
17 |
Top = 1560 |
18 |
Width = 1605 |
19 |
End |
20 |
Begin VB.CommandButton Command_RouteAdd |
21 |
Caption = "&Add Route" |
22 |
Height = 345 |
23 |
Left = 4770 |
24 |
TabIndex = 3 |
25 |
Top = 1140 |
26 |
Width = 1605 |
27 |
End |
28 |
Begin VB.CommandButton Command_Hangup |
29 |
Caption = "&Hangup" |
30 |
Height = 345 |
31 |
Left = 4770 |
32 |
TabIndex = 2 |
33 |
Top = 510 |
34 |
Width = 1605 |
35 |
End |
36 |
Begin VB.CommandButton Command_Dial |
37 |
Caption = "&Dial" |
38 |
Height = 345 |
39 |
Left = 4770 |
40 |
TabIndex = 1 |
41 |
Top = 90 |
42 |
Width = 1605 |
43 |
End |
44 |
Begin VB.ListBox List_Connections |
45 |
Height = 3375 |
46 |
Left = 60 |
47 |
TabIndex = 0 |
48 |
Top = 60 |
49 |
Width = 4605 |
50 |
End |
51 |
End |
52 |
Attribute VB_Name = "Form_Main" |
53 |
Attribute VB_GlobalNameSpace = False |
54 |
Attribute VB_Creatable = False |
55 |
Attribute VB_PredeclaredId = True |
56 |
Attribute VB_Exposed = False |
57 |
' use http://www.codeproject.com/staticctrl/gifanimation.asp ??? |
58 |
|
59 |
Option Explicit |
60 |
|
61 |
Private Sub Form_Load() |
62 |
Dim rasItem As RasEntryData |
63 |
For Each rasItem In RasEntries |
64 |
List_Connections.AddItem rasItem.entryname |
65 |
Next |
66 |
End Sub |
67 |
|
68 |
Private Sub Command_Dial_Click() |
69 |
|
70 |
Dim conName As String, rasItem As RasEntryData |
71 |
Dim success As Boolean |
72 |
|
73 |
'InternetConnect "dachboden" |
74 |
'success = RasConnect("dachboden", "C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\Microsoft\Network\Connections\Pbk\rasphone.pbk") |
75 |
|
76 |
conName = List_Connections.Text |
77 |
|
78 |
If (conName = "") Then |
79 |
MsgBox "Bitte Eintrag auswählen!" |
80 |
Exit Sub |
81 |
End If |
82 |
|
83 |
Set rasItem = RasEntries(conName) |
84 |
success = RasConnect(rasItem.entryname, rasItem.PhonebookPath) |
85 |
|
86 |
Dim ClientIP As String |
87 |
If (success = True) Then |
88 |
ClientIP = DetermineClientIP(rasItem.entryname) |
89 |
MsgBox "Eingewählt: " & ClientIP, , "Status" |
90 |
Else |
91 |
MsgBox "Fehler bei der Einwahl!", , "Status" |
92 |
End If |
93 |
|
94 |
'Picture_Animation.Appearance= |
95 |
|
96 |
End Sub |
97 |
|
98 |
Private Sub Command_Hangup_Click() |
99 |
|
100 |
Dim conName As String |
101 |
Dim success As Boolean |
102 |
|
103 |
conName = List_Connections.Text |
104 |
|
105 |
If (conName = "") Then |
106 |
MsgBox "Bitte Eintrag auswählen!" |
107 |
Exit Sub |
108 |
End If |
109 |
|
110 |
'Set rasItem = RasEntries(conName) |
111 |
success = RasDisconnect(conName) |
112 |
If (success = True) Then |
113 |
MsgBox "Verbindung getrennt.", , "Status" |
114 |
End If |
115 |
|
116 |
End Sub |
117 |
|
118 |
Private Sub Command_RouteAdd_Click() |
119 |
MsgBox RouteAdd(0, "192.168.11.0", "255.255.255.0", "192.168.13.1") |
120 |
End Sub |
121 |
|
122 |
|