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 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
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
.
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 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
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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
...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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,...
|
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$) {
}
...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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: 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,...
|
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...
| |