|
-
Dec 6th, 2000, 04:02 AM
#1
Thread Starter
Lively Member
Can anyone tell me how to connect to the internet from Windows NT? The normal 98 code doesn't work
Cheers
Chris
-
Dec 6th, 2000, 05:11 AM
#2
Fanatic Member
Use the following API's to connect, they are in wininet.dll
Code:
Public Declare Function InternetAutodial Lib "wininet.dll" _
(ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
Public Declare Function InternetAutodialHangup Lib "wininet.dll" _
(ByVal dwReserved As Long) As Long
Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long
Public Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Public Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
'you might have to move this code around a bit...
If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0)
Then
'you are connected
End If
'To automatically start dialling
If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then
'You are connected
End If
'To disconnect an automatically dialled connection
If InternetAutodialHangup(0) Then
'you are disconnected
endif
the code above will automatically dial your default connection if you use the unattended code, but if you use the INTERNET_AUTODIAL_FORCE_ONLINE constant then the standard dialog will appear and will prompt you for connection.
hth
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Dec 8th, 2000, 09:20 AM
#3
Thread Starter
Lively Member
Is there anyway of dialing a specific named connection or changing the default connection to a specific name?
-
Dec 8th, 2000, 09:31 AM
#4
Fanatic Member
I messed around with this for ages, but because there are so many differences between the API's depending upon which OS you are using, I decided to bin the idea and use the free OCX from catalyst.com (socketwrench). It handles all your dialing "stuff", and is dead easy to use, there are probably others out there, but this one worked for me. If you are really intent on using the API, there is a RAS sample on MSDN I think...
hope this helps.
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Dec 9th, 2000, 05:30 AM
#5
Lively Member
Try this way:
Public Sub ModemCallWin95_98()
Dim WIN
WIN = Shell("rundll32.exe rnaui.dll,RnaDial " & "Your ISP Name", 1)
End Sub
Public Sub ModemCallWinNT()
Dim NT
NT = Shell("rasphone.exe [-d Your ISP Name]", 1)
End Sub
-Dj4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|