|
-
Mar 10th, 2000, 10:43 PM
#1
Thread Starter
New Member
How can i code a program that detects if the computer is connected to the internet, and if not dials a connection.... and then goes to outlook express (already open) and runs the option "tools/send and receive/send and receive all" (shortcut <ctrl c>).
thanks,
Dan
-
Mar 11th, 2000, 12:07 AM
#2
Hyperactive Member
I believe you need to set your connection properties to "Dial Automatically". Then, when Outlook is told to send the message, it will look to see if there is a connection. If there isn't one, it should start one. If you don't have the connection set to Dial Automatically, you will get the Dial-Up connection dialog box which will wait until you hit "Connect".
-
Mar 11th, 2000, 01:07 AM
#3
Thread Starter
New Member
automation
thanks for that, but it won't work for what i want. I keep getting disconnected from my ISP, and so i can't leave my computer to download newsgroups etc. so i want it to detect if a connection has been dropped, redial and connect it again and then start downloading from the newsgroups again, without me needing to be there looking over it all the time.
thanks,
Dan
-
Mar 11th, 2000, 03:53 AM
#4
Fanatic Member
Here's the first part:
Hi Dan.
This code will detect if you are connected to the Internet:
Code:
Option Explicit
Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long
Public Const INTERNET_CONNECTION_LAN As Long = &H2
Public Const INTERNET_CONNECTION_MODEM As Long = &H1
Public Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef lpSFlags As Long, _
ByVal dwReserved As Long) As Long
Public Function Online() As Boolean
'If you are online it will return True, otherwise False
Online = InternetGetConnectedState(0& ,0&)
End Function
Do a search of VB-World and you should be able to find an example of using a Dial-Up Connection through VB Code.
All the best.
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
|