1 |
Attribute VB_Name = "InternetConnection" |
2 |
Option Explicit |
3 |
|
4 |
' http://www.activevb.de/tipps/vb6tipps/tipp0049.html |
5 |
|
6 |
Private Declare Function InternetDial Lib "wininet.dll" _ |
7 |
(ByVal hwndParent As Long, ByVal lpszConiID _ |
8 |
As String, ByVal dwFlags As Long, ByRef hCon _ |
9 |
As Long, ByVal dwReserved As Long) As Long |
10 |
|
11 |
Private Declare Function InternetHangUp Lib "wininet.dll" _ |
12 |
(ByVal hCon As Long, ByVal dwReserved _ |
13 |
As Long) As Long |
14 |
|
15 |
Const DIAL_UNATTENDED As Long = &H8000& |
16 |
Const DIAL_FORCE_ONLINE As Long = 1& |
17 |
Const DIAL_FORCE_UNATTENDED As Long = 2& |
18 |
|
19 |
|
20 |
Public Function InternetConnect(conName As String) |
21 |
Dim ConID As Long |
22 |
InternetDial Form_Main.hWnd, conName, DIAL_FORCE_UNATTENDED, ConID, 0 |
23 |
InternetConnect = ConID |
24 |
End Function |
25 |
|
26 |
Public Function InternetDisconnect(ConID As Long) |
27 |
If ConID Then InternetDisconnect = InternetHangUp(ConID, 0) |
28 |
End Function |
29 |
|
30 |
|