Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Disconnecting from Internet

Posted on 1998-09-02
5
184 Views
Last Modified: 2010-04-04
Hi guys,

does anyone of you know how to disconnect from internet, when the connection is done via automatic-dial-up networking?

Here what I want to do, in more detail:

I am writing an automated FTP client using a freeware FTP component. The client shall connect to internet (via dial-up), then upload something, then disconnect.

Connecting works fine, because windows connects automatically, when I do the ftp.connect command. But how can I disconnect, after the upload is finished?
Althogh windows disconnects automatically after say 10 minutes, this is not satisfying.

I already know that I need some WinApi functions (e.g. RasEnumConnections and RasDisconnect or something like that), but how to do it in Delphi 3.0??

Are there componetns?

Regards
  Mirko
0
Comment
Question by:Mirko
5 Comments
 
LVL 7

Expert Comment

by:BlackMan
ID: 1338468
Check RunDUN at http://www.geocities.com/CapeCanaveral/9646/, it might be able to do what you want..
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1338469
mirko

Yes you do need to use the windows API RasEnumConnections to get a handle of the connection, then you call the RasHangUp API call once you have the handle for the connection...

RasHangUp(RasHandle);

where Rashandle is the handle obtained from RasEnumConnections...

Check the win32 helpfile for the details of RasEnumConnections.

Later
BoRiS
0
 
LVL 4

Expert Comment

by:itamar
ID: 1338470
Hi Mirko,

there is a great RAS example in FPiette´s site. Full control over dial-up connections.
Take a look at:

http://www.rtfm.be/fpiette/rasdialuk.htm

I can accept some points if you find this link usefull ;-)))

bye,
Itamar
0
 

Author Comment

by:Mirko
ID: 1338471
Sorry Boris, your "Answer" was just typing what I already knew!!

Hi Itamar,
pose your comment as "Answer", I will accept it so that you will receive your credits.
0
 
LVL 4

Accepted Solution

by:
itamar earned 100 total points
ID: 1338472
Hi Mirko,

     there is a great RAS example in FPiette´s site. Full control over dial-up
     connections.
     Take a look at:

     http://www.rtfm.be/fpiette/rasdialuk.htm

     bye,
     Itamar
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 112
TEMBEDDEDWB how can i change its user agent ? 8 69
Firemonkey allowing RTL on android 6 43
Microsoft Access 97 and Delphi XE2 9 50
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 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