Solved

Disconnecting from Internet

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now