Solved

Auto dial up

Posted on 2002-06-02
4
195 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

810 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