PC Review


Reply
Thread Tools Rate Thread

Connecting to internet question

 
 
BobAchgill
Guest
Posts: n/a
 
      25th Nov 2004
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

 
Reply With Quote
 
 
 
 
Gerry O'Brien [MVP]
Guest
Posts: n/a
 
      25th Nov 2004
ConfigurationSettings.AppSettings("DialupMethod")


--
Gerry O'Brien
Visual Basic .NET MVP


"BobAchgill" <(E-Mail Removed)> wrote in message
news:1dd401c4d2e9$c6c3f340$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
BobAchgill
Guest
Posts: n/a
 
      25th Nov 2004
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" <(E-Mail Removed)> wrote

in message
>news:1dd401c4d2e9$c6c3f340$(E-Mail Removed)...
>> 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
>>

>
>
>.
>

 
Reply With Quote
 
Gerry O'Brien [MVP]
Guest
Posts: n/a
 
      26th Nov 2004
Do you have System.Configuration imported at the top of your code file?

--
Gerry O'Brien
Visual Basic .NET MVP


"BobAchgill" <(E-Mail Removed)> wrote in message
news:8b9201c4d334$a3879b70$(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote

> in message
>>news:1dd401c4d2e9$c6c3f340$(E-Mail Removed)...
>>> 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
>>>

>>
>>
>>.
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting to internet warsaw1 Windows Vista Installation 3 3rd Jan 2008 10:27 PM
Computer freezes after connecting to internet through internet exp =?Utf-8?B?Uy4gQWxleGFuZGVy?= Windows XP Performance 3 12th Dec 2005 11:34 PM
Connecting Internet with Internet connection sharing (ICS) in winxp Harjeet singh Windows XP Help 1 3rd Dec 2004 04:48 AM
Internet Explorer not connecting to internet Julie Windows XP Internet Explorer 1 20th Sep 2004 07:20 PM
semi-newbie connecting to a mac over internet question =?Utf-8?B?c2tlbmlzYWhlbg==?= Windows XP Networking 1 11th Jul 2004 02:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:15 PM.