473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Check Internet connection, prompt dial-up dialog. Pls Help!

Hi, I've posted this question on several forum but have no response. So I
hope anyone who have any idea what I'm talking about please give your
solution or advice.

My problem is I need to check the internet connection and pop-up a Dial-Up
dialog when there isn't any?

I've tried the following:

Dim myReq As HttpWebRequest
Try
myReq = WebRequest.Create("http://www.yahoo.com/")
myReq.GetResponse()
Catch ex As Exception
----------------> prompt for Dial-Up dialog here
End Try

The checking part is ok so far. But it can't automatically dial up or prompt
for dial up.

I need your advice on the correct way in doing this. Your help is much
appreciated. Thanks.
Jul 21 '05 #1
9 2272
Try using the WinInet API

Clas

"sleepyant" <no@nono.no> wrote in message
news:Oq**************@TK2MSFTNGP15.phx.gbl...
Hi, I've posted this question on several forum but have no response. So I
hope anyone who have any idea what I'm talking about please give your
solution or advice.

My problem is I need to check the internet connection and pop-up a Dial-Up
dialog when there isn't any?

I've tried the following:

Dim myReq As HttpWebRequest
Try
myReq = WebRequest.Create("http://www.yahoo.com/")
myReq.GetResponse()
Catch ex As Exception
----------------> prompt for Dial-Up dialog here
End Try

The checking part is ok so far. But it can't automatically dial up or prompt for dial up.

I need your advice on the correct way in doing this. Your help is much
appreciated. Thanks.

Jul 21 '05 #2
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL ncpa.cpl,,0");

This will open the "Network Connections" control panel. This is not exactly
dial-up dialog but at least it's one step closer :)

--
Victor Hadianto
http://synop.com/Products/SauceReader/
"sleepyant" <no@nono.no> wrote in message
news:Oq**************@TK2MSFTNGP15.phx.gbl...
Hi, I've posted this question on several forum but have no response. So I
hope anyone who have any idea what I'm talking about please give your
solution or advice.

My problem is I need to check the internet connection and pop-up a Dial-Up
dialog when there isn't any?

I've tried the following:

Dim myReq As HttpWebRequest
Try
myReq = WebRequest.Create("http://www.yahoo.com/")
myReq.GetResponse()
Catch ex As Exception
----------------> prompt for Dial-Up dialog here
End Try

The checking part is ok so far. But it can't automatically dial up or
prompt
for dial up.

I need your advice on the correct way in doing this. Your help is much
appreciated. Thanks.

Jul 21 '05 #3
On Fri, 5 Nov 2004 13:31:04 +0800, "sleepyant" <no@nono.no> wrote:

¤ Hi, I've posted this question on several forum but have no response. So I
¤ hope anyone who have any idea what I'm talking about please give your
¤ solution or advice.
¤
¤ My problem is I need to check the internet connection and pop-up a Dial-Up
¤ dialog when there isn't any?
¤
¤ I've tried the following:
¤
¤ Dim myReq As HttpWebRequest
¤ Try
¤ myReq = WebRequest.Create("http://www.yahoo.com/")
¤ myReq.GetResponse()
¤ Catch ex As Exception
¤ ----------------> prompt for Dial-Up dialog here
¤ End Try
¤
¤ The checking part is ok so far. But it can't automatically dial up or prompt
¤ for dial up.
¤
¤ I need your advice on the correct way in doing this. Your help is much
¤ appreciated. Thanks.
¤

See the following:

http://makeashorterlink.com/?K3F3155B9
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #4
Thanks all. Appreciate your help. If I use "wininet.dll", do I need to
distribute "wininet.dll" together in my application setup? Or it is already
exist in existing windows OS and won't have any 'dll hell' issue? Thanks
again.
Jul 21 '05 #5
Paul Clement wrote:
On Fri, 5 Nov 2004 13:31:04 +0800, "sleepyant" <no@nono.no> wrote:

¤ Hi, I've posted this question on several forum but have no response. So I
¤ hope anyone who have any idea what I'm talking about please give your
¤ solution or advice.
¤
¤ My problem is I need to check the internet connection and pop-up a Dial-Up
¤ dialog when there isn't any?
¤
¤ I've tried the following:
¤
¤ Dim myReq As HttpWebRequest
¤ Try
¤ myReq = WebRequest.Create("http://www.yahoo.com/")
¤ myReq.GetResponse()
¤ Catch ex As Exception
¤ ----------------> prompt for Dial-Up dialog here
¤ End Try
¤
¤ The checking part is ok so far. But it can't automatically dial up or prompt
¤ for dial up.
¤
¤ I need your advice on the correct way in doing this. Your help is much
¤ appreciated. Thanks.
¤

See the following:

http://makeashorterlink.com/?K3F3155B9

Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


Paul, I copied the code from the link you provided and tried it out. It did
successfully detect if a connection was there or not, but failed on the following
line:
x = Shell("rundll32.exe rnaui.dll,RnaDial",
AppWinStyle.NormalFocus, False)

I did a search for rundll32.exe and rnaui.dll , neither file exists on my XP
machine. Since DUN does work on this machine, I can only assume that these items
are replaced with other files in XP. So the question becomes then, what command
should be substituted for this line to work with XP-SP2?

tia
gm
Jul 21 '05 #6
On Sat, 06 Nov 2004 12:38:45 -0600, gm******@nospam.xyz wrote:

¤ Paul Clement wrote:
¤
¤ > On Fri, 5 Nov 2004 13:31:04 +0800, "sleepyant" <no@nono.no> wrote:
¤ >
¤ > ¤ Hi, I've posted this question on several forum but have no response. So I
¤ > ¤ hope anyone who have any idea what I'm talking about please give your
¤ > ¤ solution or advice.
¤ > ¤
¤ > ¤ My problem is I need to check the internet connection and pop-up a Dial-Up
¤ > ¤ dialog when there isn't any?
¤ > ¤
¤ > ¤ I've tried the following:
¤ > ¤
¤ > ¤ Dim myReq As HttpWebRequest
¤ > ¤ Try
¤ > ¤ myReq = WebRequest.Create("http://www.yahoo.com/")
¤ > ¤ myReq.GetResponse()
¤ > ¤ Catch ex As Exception
¤ > ¤ ----------------> prompt for Dial-Up dialog here
¤ > ¤ End Try
¤ > ¤
¤ > ¤ The checking part is ok so far. But it can't automatically dial up or prompt
¤ > ¤ for dial up.
¤ > ¤
¤ > ¤ I need your advice on the correct way in doing this. Your help is much
¤ > ¤ appreciated. Thanks.
¤ > ¤
¤ >
¤ > See the following:
¤ >
¤ > http://makeashorterlink.com/?K3F3155B9
¤ >
¤ > Paul ~~~ pc******@ameritech.net
¤ > Microsoft MVP (Visual Basic)
¤
¤ Paul, I copied the code from the link you provided and tried it out. It did
¤ successfully detect if a connection was there or not, but failed on the following
¤ line:
¤ x = Shell("rundll32.exe rnaui.dll,RnaDial",
¤ AppWinStyle.NormalFocus, False)
¤
¤ I did a search for rundll32.exe and rnaui.dll , neither file exists on my XP
¤ machine. Since DUN does work on this machine, I can only assume that these items
¤ are replaced with other files in XP. So the question becomes then, what command
¤ should be substituted for this line to work with XP-SP2?

Try RasDial instead:

http://home.iprimus.com.au/billmcc/P...VB/Default.htm
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #7
Paul Clement wrote:
On Sat, 06 Nov 2004 12:38:45 -0600, gm******@nospam.xyz wrote:

¤ Paul Clement wrote:
¤
¤ > On Fri, 5 Nov 2004 13:31:04 +0800, "sleepyant" <no@nono.no> wrote:
¤ >
¤ > ¤ Hi, I've posted this question on several forum but have no response. So I
¤ > ¤ hope anyone who have any idea what I'm talking about please give your
¤ > ¤ solution or advice.
¤ > ¤
¤ > ¤ My problem is I need to check the internet connection and pop-up a Dial-Up
¤ > ¤ dialog when there isn't any?
¤ > ¤
¤ > ¤ I've tried the following:
¤ > ¤
¤ > ¤ Dim myReq As HttpWebRequest
¤ > ¤ Try
¤ > ¤ myReq = WebRequest.Create("http://www.yahoo.com/")
¤ > ¤ myReq.GetResponse()
¤ > ¤ Catch ex As Exception
¤ > ¤ ----------------> prompt for Dial-Up dialog here
¤ > ¤ End Try
¤ > ¤
¤ > ¤ The checking part is ok so far. But it can't automatically dial up or prompt
¤ > ¤ for dial up.
¤ > ¤
¤ > ¤ I need your advice on the correct way in doing this. Your help is much
¤ > ¤ appreciated. Thanks.
¤ > ¤
¤ >
¤ > See the following:
¤ >
¤ > http://makeashorterlink.com/?K3F3155B9
¤ >
¤ > Paul ~~~ pc******@ameritech.net
¤ > Microsoft MVP (Visual Basic)
¤
¤ Paul, I copied the code from the link you provided and tried it out. It did
¤ successfully detect if a connection was there or not, but failed on the following
¤ line:
¤ x = Shell("rundll32.exe rnaui.dll,RnaDial",
¤ AppWinStyle.NormalFocus, False)
¤
¤ I did a search for rundll32.exe and rnaui.dll , neither file exists on my XP
¤ machine. Since DUN does work on this machine, I can only assume that these items
¤ are replaced with other files in XP. So the question becomes then, what command
¤ should be substituted for this line to work with XP-SP2?

Try RasDial instead:

http://home.iprimus.com.au/billmcc/P...VB/Default.htm

Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


Thanks for the followup, there is a lot at that website to sift through..
gm
Jul 21 '05 #8
On Mon, 08 Nov 2004 21:20:55 -0600, gm******@nospam.xyz wrote:

¤ Paul Clement wrote:
¤
¤ > On Sat, 06 Nov 2004 12:38:45 -0600, gm******@nospam.xyz wrote:
¤ >
¤ > ¤ Paul Clement wrote:
¤ > ¤
¤ > ¤ > On Fri, 5 Nov 2004 13:31:04 +0800, "sleepyant" <no@nono.no> wrote:
¤ > ¤ >
¤ > ¤ > ¤ Hi, I've posted this question on several forum but have no response. So I
¤ > ¤ > ¤ hope anyone who have any idea what I'm talking about please give your
¤ > ¤ > ¤ solution or advice.
¤ > ¤ > ¤
¤ > ¤ > ¤ My problem is I need to check the internet connection and pop-up a Dial-Up
¤ > ¤ > ¤ dialog when there isn't any?
¤ > ¤ > ¤
¤ > ¤ > ¤ I've tried the following:
¤ > ¤ > ¤
¤ > ¤ > ¤ Dim myReq As HttpWebRequest
¤ > ¤ > ¤ Try
¤ > ¤ > ¤ myReq = WebRequest.Create("http://www.yahoo.com/")
¤ > ¤ > ¤ myReq.GetResponse()
¤ > ¤ > ¤ Catch ex As Exception
¤ > ¤ > ¤ ----------------> prompt for Dial-Up dialog here
¤ > ¤ > ¤ End Try
¤ > ¤ > ¤
¤ > ¤ > ¤ The checking part is ok so far. But it can't automatically dial up or prompt
¤ > ¤ > ¤ for dial up.
¤ > ¤ > ¤
¤ > ¤ > ¤ I need your advice on the correct way in doing this. Your help is much
¤ > ¤ > ¤ appreciated. Thanks.
¤ > ¤ > ¤
¤ > ¤ >
¤ > ¤ > See the following:
¤ > ¤ >
¤ > ¤ > http://makeashorterlink.com/?K3F3155B9
¤ > ¤ >
¤ > ¤ > Paul ~~~ pc******@ameritech.net
¤ > ¤ > Microsoft MVP (Visual Basic)
¤ > ¤
¤ > ¤ Paul, I copied the code from the link you provided and tried it out. It did
¤ > ¤ successfully detect if a connection was there or not, but failed on the following
¤ > ¤ line:
¤ > ¤ x = Shell("rundll32.exe rnaui.dll,RnaDial",
¤ > ¤ AppWinStyle.NormalFocus, False)
¤ > ¤
¤ > ¤ I did a search for rundll32.exe and rnaui.dll , neither file exists on my XP
¤ > ¤ machine. Since DUN does work on this machine, I can only assume that these items
¤ > ¤ are replaced with other files in XP. So the question becomes then, what command
¤ > ¤ should be substituted for this line to work with XP-SP2?
¤ >
¤ > Try RasDial instead:
¤ >
¤ > http://home.iprimus.com.au/billmcc/P...VB/Default.htm
¤ >
¤ > Paul ~~~ pc******@ameritech.net
¤ > Microsoft MVP (Visual Basic)
¤
¤ Thanks for the followup, there is a lot at that website to sift through..
¤ gm

Here is the direct link to RasDial:

http://home.iprimus.com.au/billmcc/P.../dialother.htm
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #9
Paul Clement wrote:
On Mon, 08 Nov 2004 21:20:55 -0600, gm******@nospam.xyz wrote:

¤ Paul Clement wrote:
¤
¤ > On Sat, 06 Nov 2004 12:38:45 -0600, gm******@nospam.xyz wrote:
¤ >
¤ > ¤ Paul Clement wrote:
¤ > ¤
¤ > ¤ > On Fri, 5 Nov 2004 13:31:04 +0800, "sleepyant" <no@nono.no> wrote:
¤ > ¤ >
¤ > ¤ > ¤ Hi, I've posted this question on several forum but have no response. So I
¤ > ¤ > ¤ hope anyone who have any idea what I'm talking about please give your
¤ > ¤ > ¤ solution or advice.
¤ > ¤ > ¤
¤ > ¤ > ¤ My problem is I need to check the internet connection and pop-up a Dial-Up
¤ > ¤ > ¤ dialog when there isn't any?
¤ > ¤ > ¤
¤ > ¤ > ¤ I've tried the following:
¤ > ¤ > ¤
¤ > ¤ > ¤ Dim myReq As HttpWebRequest
¤ > ¤ > ¤ Try
¤ > ¤ > ¤ myReq = WebRequest.Create("http://www.yahoo.com/")
¤ > ¤ > ¤ myReq.GetResponse()
¤ > ¤ > ¤ Catch ex As Exception
¤ > ¤ > ¤ ----------------> prompt for Dial-Up dialog here
¤ > ¤ > ¤ End Try
¤ > ¤ > ¤
¤ > ¤ > ¤ The checking part is ok so far. But it can't automatically dial up or prompt
¤ > ¤ > ¤ for dial up.
¤ > ¤ > ¤
¤ > ¤ > ¤ I need your advice on the correct way in doing this. Your help is much
¤ > ¤ > ¤ appreciated. Thanks.
¤ > ¤ > ¤
¤ > ¤ >
¤ > ¤ > See the following:
¤ > ¤ >
¤ > ¤ > http://makeashorterlink.com/?K3F3155B9
¤ > ¤ >
¤ > ¤ > Paul ~~~ pc******@ameritech.net
¤ > ¤ > Microsoft MVP (Visual Basic)
¤ > ¤
¤ > ¤ Paul, I copied the code from the link you provided and tried it out. It did
¤ > ¤ successfully detect if a connection was there or not, but failed on the following
¤ > ¤ line:
¤ > ¤ x = Shell("rundll32.exe rnaui.dll,RnaDial",
¤ > ¤ AppWinStyle.NormalFocus, False)
¤ > ¤
¤ > ¤ I did a search for rundll32.exe and rnaui.dll , neither file exists on my XP
¤ > ¤ machine. Since DUN does work on this machine, I can only assume that these items
¤ > ¤ are replaced with other files in XP. So the question becomes then, what command
¤ > ¤ should be substituted for this line to work with XP-SP2?
¤ >
¤ > Try RasDial instead:
¤ >
¤ > http://home.iprimus.com.au/billmcc/P...VB/Default.htm
¤ >
¤ > Paul ~~~ pc******@ameritech.net
¤ > Microsoft MVP (Visual Basic)
¤
¤ Thanks for the followup, there is a lot at that website to sift through..
¤ gm

Here is the direct link to RasDial:

http://home.iprimus.com.au/billmcc/P.../dialother.htm

Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


Thanks, and that did work. I had to use the coding version that included username and
password, otherwise the connection immediately hung up. Step one in replacing DUN GUI
complete!
gm
Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kadir CAMOGLU | last post by:
Hi all, I am writing a program with vb.net which getting some information from internet. I must check internet connection before some prosess. But how?
5
by: F. Biguet | last post by:
Hello, I want to create a generic script that connects to Oracle databases (from 7.3.4 to 9.2 version) with a guest user. This script should return 1 if connection is successful and 0 if not....
10
by: John | last post by:
Hi I am using ms internet control in my app. It works fine form all machines except from a new one which has win xp sp2 installed. All machines are part of a small business server 2003 domain so...
1
by: Sean Barnes | last post by:
Hello all, I am having a bit a problem with the InternetDial function in the wininet.dll. The problem is that despite passing in a null terminated string as the lpszConnectoid param to the...
2
by: Timothy V | last post by:
Hi, Does anyone know how to dial a connection to the internet in C#? Thanks, Tim.
4
by: Dirk Reske | last post by:
Hello, is there a way to get informed before a connections is established? I want to know the number that is going to be dialed... thx ------------------------------------------------ I...
1
by: Grey | last post by:
my web server is in domain. how can I check the user login with the AD's user account?? does it required the client's browser and web server located in the same domain?? and what is the different...
10
by: Bob Hollness | last post by:
OK. The below text is from the MySQL website. "When you connect to a MySQL server, you should use a password. The password is not transmitted in clear text over the connection. Password handling...
9
by: Joe | last post by:
Every time our application starts it prompts the user to allow it access to the internet because our application is checking for updates. Is there anyway programically to tell Vista to allow this...
1
by: jeffreykr | last post by:
hi, i am trying to this from portable code. ie, i have seen how to check for a live connection from .NET but i'm not using those libraries. any other way to check for a live internet connection...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.