473,386 Members | 1,830 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,386 software developers and data experts.

Connecting to internet question

When I use this class below it says "Name 'config' not
declared" for the following line:

Dim sMethod As String = config.AppSettings("DialupMethod")

How do I declare this guy?

Thanks,

Bob
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++
+++++++
' Dialer Class
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++
+++++++
Public Class InternetDialer
Public Declare Function InternetAutodial
Lib "wininet.dll" _
(ByVal dwFlags As Long, ByVal dwReserved As Long) As
Long

'flags for InternetAutodial
Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2

Private Declare Function InternetAutodialHangup
Lib "wininet.dll" _
(ByVal dwReserved As Long) As Long

Public Sub Dialup()
Try
Dim sMethod As String = config.AppSettings
("DialupMethod")

Select Case sMethod
Case "Prompt" 'To prompt the user to
connect to the Net
InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0&)
'InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0)

Case "Auto" 'To automatically start
dialling
InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0&)

'InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0)
End Select
Catch ex As Exception

End Try
End Sub

Public Sub HangUp()
'To disconnect an automatically dialled connection
InternetAutodialHangup(0&)
End Sub

End Class

Nov 21 '05 #1
3 2880
ConfigurationSettings.AppSettings("DialupMethod")
--
Gerry O'Brien
Visual Basic .NET MVP
"BobAchgill" <an*******@discussions.microsoft.com> wrote in message
news:1d****************************@phx.gbl...
When I use this class below it says "Name 'config' not
declared" for the following line:

Dim sMethod As String = config.AppSettings("DialupMethod")

How do I declare this guy?

Thanks,

Bob
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++
+++++++
' Dialer Class
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++
+++++++
Public Class InternetDialer
Public Declare Function InternetAutodial
Lib "wininet.dll" _
(ByVal dwFlags As Long, ByVal dwReserved As Long) As
Long

'flags for InternetAutodial
Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2

Private Declare Function InternetAutodialHangup
Lib "wininet.dll" _
(ByVal dwReserved As Long) As Long

Public Sub Dialup()
Try
Dim sMethod As String = config.AppSettings
("DialupMethod")

Select Case sMethod
Case "Prompt" 'To prompt the user to
connect to the Net
InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0&)
'InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0)

Case "Auto" 'To automatically start
dialling
InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0&)

'InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0)
End Select
Catch ex As Exception

End Try
End Sub

Public Sub HangUp()
'To disconnect an automatically dialled connection
InternetAutodialHangup(0&)
End Sub

End Class

Nov 21 '05 #2
I tried putting that line in the code below and still
come up with declaration error... but now on the line you
suggest.

Hummm??

-----Original Message-----
ConfigurationSettings.AppSettings("DialupMethod ")
--
Gerry O'Brien
Visual Basic .NET MVP
"BobAchgill" <an*******@discussions.microsoft.com> wrote in messagenews:1d****************************@phx.gbl...
When I use this class below it says "Name 'config' not
declared" for the following line:

Dim sMethod As String = config.AppSettings ("DialupMethod")
How do I declare this guy?

Thanks,

Bob
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++ +++++++
' Dialer Class
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++ +++++++
Public Class InternetDialer
Public Declare Function InternetAutodial
Lib "wininet.dll" _
(ByVal dwFlags As Long, ByVal dwReserved As Long) As
Long

'flags for InternetAutodial
Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2

Private Declare Function InternetAutodialHangup
Lib "wininet.dll" _
(ByVal dwReserved As Long) As Long

Public Sub Dialup()
Try
Dim sMethod As String = config.AppSettings
("DialupMethod")

Select Case sMethod
Case "Prompt" 'To prompt the user to
connect to the Net
InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0&)
'InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0)

Case "Auto" 'To automatically start
dialling
InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0&)

'InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0)
End Select
Catch ex As Exception

End Try
End Sub

Public Sub HangUp()
'To disconnect an automatically dialled connection InternetAutodialHangup(0&)
End Sub

End Class

.

Nov 21 '05 #3
Do you have System.Configuration imported at the top of your code file?

--
Gerry O'Brien
Visual Basic .NET MVP
"BobAchgill" <an*******@discussions.microsoft.com> wrote in message
news:8b****************************@phx.gbl...
I tried putting that line in the code below and still
come up with declaration error... but now on the line you
suggest.

Hummm??

-----Original Message-----
ConfigurationSettings.AppSettings("DialupMethod" )
--
Gerry O'Brien
Visual Basic .NET MVP
"BobAchgill" <an*******@discussions.microsoft.com> wrote

in message
news:1d****************************@phx.gbl...
When I use this class below it says "Name 'config' not
declared" for the following line:

Dim sMethod As String = config.AppSettings ("DialupMethod")
How do I declare this guy?

Thanks,

Bob
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++ +++++++
' Dialer Class
'
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++ +++++++
Public Class InternetDialer
Public Declare Function InternetAutodial
Lib "wininet.dll" _
(ByVal dwFlags As Long, ByVal dwReserved As Long) As
Long

'flags for InternetAutodial
Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2

Private Declare Function InternetAutodialHangup
Lib "wininet.dll" _
(ByVal dwReserved As Long) As Long

Public Sub Dialup()
Try
Dim sMethod As String = config.AppSettings
("DialupMethod")

Select Case sMethod
Case "Prompt" 'To prompt the user to
connect to the Net
InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0&)
'InternetAutodial
(INTERNET_AUTODIAL_FORCE_ONLINE, 0)

Case "Auto" 'To automatically start
dialling
InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0&)

'InternetAutodial
(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0)
End Select
Catch ex As Exception

End Try
End Sub

Public Sub HangUp()
'To disconnect an automatically dialled connection InternetAutodialHangup(0&)
End Sub

End Class

.

Nov 21 '05 #4

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

Similar topics

5
by: Matt | last post by:
I know it is possible to establish a connection to an SQL Server over the Internet via Enterprise Manager. My question is, how secure is this connection? Is there a best practices document for this...
5
by: jersey | last post by:
I am creating an instance of Excel in a WinForm application. When I try to run this application, there is a long wait followed by a message from my firewall that my application is attempting to...
1
by: Dishaa V | last post by:
Hello I need to connect to an access db which is on the internet. I do know that URL of the same. its http://www.vallury.com/balance/bank.mdb. Its just a test db. How can I connect to that db...
1
by: Paras Sharma | last post by:
Hi all, this is a query more than a problem. I have a task in hand, whose scenario is as follows. i have a window application, using a button on which (say 'upload' or 'download') i need to...
3
by: chethana | last post by:
I am using copmaq ipaq pocket pc 2002 h3600 series. This device is synchronized with desk top pc running on windows 2000. I want this pocket pc to be conncted to internet .Kindly help ...
3
by: GTDriver | last post by:
I'm trying to connect my application with a web service located on my own web server(localhost). I guess when the solution/proect is built it makes a file called 'Web...
18
by: Barry Wright | last post by:
Hi All, I have been connecting to this group through Rogers cable my internet service provider. However, Rogers has announced that effective Dec 15th they will no longer providing access to...
7
by: TerpZebra | last post by:
I am having difficulty connecting to SQL Server 2000 on one of our servers via a VB6 program on Vista. I can connect fine to a different server, but it gives me the following error with the server...
1
by: nagmvs | last post by:
Hai all, I want to do a project that Connecting Internet to Intranet with all security.Can any ideas please ? . My project description: We have some clients those are transcript our data...
2
by: Federico Cozzi | last post by:
Hello, in my VB.net I would like to 1) start a new Internet Explorer process (not a new window of the running process) 2) and connecting to its WebBrowser control, or InternetExplorerClass,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.