Connecting to internet question

B

BobAchgill

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
 
B

BobAchgill

I tried putting that line in the code below and still
come up with declaration error... but now on the line you
suggest.

Hummm??
 
G

Gerry O'Brien [MVP]

Do you have System.Configuration imported at the top of your code file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top