Solved

Disconnecting from Internet

Posted on 1998-09-02
5
183 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

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…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

770 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