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
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