Hi
see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetgetconnectedstateex.asp
you can find it on Wininet.h
// Flags for InternetGetConnectedState and Ex
#define INTERNET_CONNECTION_MODEM 0x01
#define INTERNET_CONNECTION_LAN 0x02
#define INTERNET_CONNECTION_PROXY 0x04
#define INTERNET_CONNECTION_MODEM_BUSY 0x08 /* no longer used */
#define INTERNET_RAS_INSTALLED 0x10
#define INTERNET_CONNECTION_OFFLINE 0x20
#define INTERNET_CONNECTION_CONFIGURED 0x40
Regards
ACP
[quoted text, click to view] "Peter" wrote:
> Hello Sergey,
>
> In which namespace is the InetFlags ? Cann't find it or maybe I'm
> overlooking something.
>
> Regards
> Peter
>
>
>
> "Sergey Bogdanov" <sergey.bogdanov@gmail.com> schreef in bericht
> news:e%23xICufKFHA.2136@TK2MSFTNGP14.phx.gbl...
> > You may try this:
> >
> > bool IsConnected
> > {
> > get
> > {
> > int flags = 0;
> > return InternetGetConnectedStateEx(out flags, 0, 0, 0);
> > }
> > }
> >
> > [DllImport("wininet.dll")]
> > private extern static bool InternetGetConnectedStateEx(out InetFlags
> > flags, int reservedValue, int dwNameLen, int dwReserved);
> >
> > Best regards,
> > Sergey Bogdanov
> >
http://www.sergeybogdanov.com > >
> >
> > David Pope wrote:
> > > Can someone point me in the right direction on how you can check to see
> if
> > > you have an active internet connect?
> > >
> > > Thanks,
> > >
> > > David
> > >
> > >
>
>
You may try this:
bool IsConnected
{
get
{
int flags = 0;
return InternetGetConnectedStateEx(out flags, 0, 0, 0);
}
}
[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedStateEx(out InetFlags
flags, int reservedValue, int dwNameLen, int dwReserved);
Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com [quoted text, click to view] David Pope wrote:
> Can someone point me in the right direction on how you can check to see if
> you have an active internet connect?
>
> Thanks,
>
> David
>
Hello Sergey,
In which namespace is the InetFlags ? Cann't find it or maybe I'm
overlooking something.
Regards
Peter
"Sergey Bogdanov" <sergey.bogdanov@gmail.com> schreef in bericht
news:e%23xICufKFHA.2136@TK2MSFTNGP14.phx.gbl...
[quoted text, click to view] > You may try this:
>
> bool IsConnected
> {
> get
> {
> int flags = 0;
> return InternetGetConnectedStateEx(out flags, 0, 0, 0);
> }
> }
>
> [DllImport("wininet.dll")]
> private extern static bool InternetGetConnectedStateEx(out InetFlags
> flags, int reservedValue, int dwNameLen, int dwReserved);
>
> Best regards,
> Sergey Bogdanov
>
http://www.sergeybogdanov.com >
>
> David Pope wrote:
> > Can someone point me in the right direction on how you can check to see
if
> > you have an active internet connect?
> >
> > Thanks,
> >
> > David
> >
> >
Just replace it with 'int'.
Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com [quoted text, click to view] Peter wrote:
> Hello Sergey,
>
> In which namespace is the InetFlags ? Cann't find it or maybe I'm
> overlooking something.
>
> Regards
> Peter
>
>
>
> "Sergey Bogdanov" <sergey.bogdanov@gmail.com> schreef in bericht
> news:e%23xICufKFHA.2136@TK2MSFTNGP14.phx.gbl...
>
>>You may try this:
>>
>>bool IsConnected
>>{
>>get
>>{
>>int flags = 0;
>>return InternetGetConnectedStateEx(out flags, 0, 0, 0);
>>}
>>}
>>
>>[DllImport("wininet.dll")]
>>private extern static bool InternetGetConnectedStateEx(out InetFlags
>>flags, int reservedValue, int dwNameLen, int dwReserved);
>>
>>Best regards,
>>Sergey Bogdanov
>>
http://www.sergeybogdanov.com >>
>>
>>David Pope wrote:
>>
>>>Can someone point me in the right direction on how you can check to see
>
> if
>
>>>you have an active internet connect?
>>>
>>>Thanks,
>>>
>>>David
>>>
>>>
>
>
Don't see what you're looking for? Try a search.