Solved

Auto dial up

Posted on 2002-06-02
4
196 Views
Last Modified: 2010-04-04
Hi
I want to build an application which AUTOMATICALLY connects to the internet via dialup connection (previously set in Dialup networking), do something over the connection (for example, send, get email, doesn't matter, I know how to do it) then AUTOMATICALLY disconnects!
some sample code?
please help
thanks
0
Comment
Question by:gikam
4 Comments
 
LVL 12

Accepted Solution

by:
Lee_Nover earned 50 total points
ID: 7052603
you use the folowing functions

uses wininet;

// this connects to the default dialup account
connected:=InternetAutoDial(INTERNET_AUTODIAL_FORCE_ONLINE or INTERNET_AUTODIAL_FORCE_UNATTENDED, 0);
//do stuff
InternetAutodialHangup(0);



another way is to specify the name of the connection you wish to use:

if InternetDial(0, PChar(ConnectionName), INTERNET_AUTODIAL_FORCE_UNATTENDED, dwConn, 0) <> ERROR_SUCCESS then exit;
// do stuff
InternetHangup(dwConn, 0);


should be simple enough
here is the MSDN link :
http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/wininet/overview/establish.asp
0
 
LVL 5

Expert Comment

by:Gwena
ID: 7053090
Listening :-)
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9010424
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from Lee_Nover

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question