|
-
Sep 13th, 2009, 08:41 PM
#1
Thread Starter
Fanatic Member
Connecting and disconnecting from an internet connection
My client want me to connect and disconnect from an internet connection automatically.
How can I do that? can we do that from batch files? Is there an API to do so>?
-
Sep 13th, 2009, 10:19 PM
#2
Re: Connecting and disconnecting from an internet connection
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Sep 13th, 2009, 11:38 PM
#3
Thread Starter
Fanatic Member
Re: Connecting and disconnecting from an internet connection
modem, dsl.
However, I think I have figured out. It's just easier to use rasdial.
Rasdial /disconnect
rasdial "Connection Name"
Works perfectly
and then use shell to run the bat file.
The client want to get a new IP from his ISP every 5 minutes or so.
-
Sep 14th, 2009, 01:01 AM
#4
Thread Starter
Fanatic Member
Re: Connecting and disconnecting from an internet connection
I wonder if there is also a shell command to make internet explorer use a certain IP settings.
-
Sep 15th, 2009, 03:26 AM
#5
Thread Starter
Fanatic Member
Re: Connecting and disconnecting from an internet connection
 Originally Posted by teguh123
I wonder if there is also a shell command to make internet explorer use a certain IP settings.
Okay, I do
Shell "Rasdial """ + whatToPut("networkconnect") + """ /DISCONNECT"
Shell "Rasdial """ + whatToPut("networkconnect") + """"
The problem is if the 2 is too close together the first command hasn't finish disconnecting before the second command finish.
I turn that into a bat file but how can we execute bat file in vb6, especially if it's network drive?
I put waiting 2 seconds between the 2 command but I do not think it's an elegant solution. I want VB to automatically connect after disconnecting.
-
Sep 15th, 2009, 05:35 AM
#6
Re: Connecting and disconnecting from an internet connection
i may be mistaken, but i would believe rasdial is only for dial up connections, nothing to do with any wan/adsl connection
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|