good day
You can tell me how I can know if there is a network connection on a PC
Thank you
I can know if there is a network connection on a PC
I can know if there is a network connection on a PC
Nolberto Paulino
Regards
Regards
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: I can know if there is a network connection on a PC
Code: Select all
IF InternetGetConnectedState( @n, 0 ) == 0
LB_Warning('The system can not check and download updates, because there is no connection to the Internet!', '(C) Eidos-X++ System"')
RunShell("",executable_module.exe,.T.)
RETURN NIL
ENDIF
Re: I can know if there is a network connection on a PC
AND WHERE IS THIS FUNCTION InternetGetConnectedState
Eugene Lutsenko wrote:[/size]Code: Select all
IF InternetGetConnectedState( @n, 0 ) == 0 LB_Warning('The system can not check and download updates, because there is no connection to the Internet!', '(C) Eidos-X++ System"') RunShell("",executable_module.exe,.T.) RETURN NIL ENDIF
Nolberto Paulino
Regards
Regards
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: I can know if there is a network connection on a PC
I use Boris Borzic's Xb2NET. I have Alaska 1.9. Maybe there's something like that in Alaska 2.0. I don't know. But I suppose there should be.
[/size]I have everything working perfectly: http://lc.kubagro.ru/__AIDOS-X.txt. I bought xb2net and several times consulted with Boris. He really, really helped me. Now I can do what I need in Alaska on the Internet.
http://xb2.net/menu.htm
http://xb2.net/xb2net/xb2_200.zip
http://xb2.net/xb2net/xb2_191.zip
Code: Select all
DLLFUNCTION InternetGetConnectedState( @nFlags, nReserved ) USING STDCALL FROM WinInet.Dll
http://xb2.net/menu.htm
http://xb2.net/xb2net/xb2_200.zip
http://xb2.net/xb2net/xb2_191.zip
Re: I can know if there is a network connection on a PC
Thank you
Eugene Lutsenko wrote:I use Boris Borzic's Xb2NET. I have Alaska 1.9. Maybe there's something like that in Alaska 2.0. I don't know. But I suppose there should be.
[/size]I have everything working perfectly: http://lc.kubagro.ru/__AIDOS-X.txt. I bought xb2net and several times consulted with Boris. He really, really helped me. Now I can do what I need in Alaska on the Internet.Code: Select all
DLLFUNCTION InternetGetConnectedState( @nFlags, nReserved ) USING STDCALL FROM WinInet.Dll
http://xb2.net/menu.htm
http://xb2.net/xb2net/xb2_200.zip
http://xb2.net/xb2net/xb2_191.zip
Nolberto Paulino
Regards
Regards
-
- Posts: 11
- Joined: Wed Feb 28, 2018 2:04 pm
- Location: Edmonton, AB, Canada
Re: I can know if there is a network connection on a PC
Hi,
I use Microsoft's Network List manager API... https://docs.microsoft.com/en-us/window ... anager-api
Originally just to check for Internet Connection but modified the function to check for either network or internet connections. The MS site lists a number of other methods as well.
If connected the result is returned quickly however if not connected appears to take "a while".
Regards... Jonathan
I use Microsoft's Network List manager API... https://docs.microsoft.com/en-us/window ... anager-api
Originally just to check for Internet Connection but modified the function to check for either network or internet connections. The MS site lists a number of other methods as well.
Code: Select all
FUNCTION NetworkConnected(pType)
LOCAL lConnected := .F.,;
oNLM
#define CLSID_NetworkListManager "{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"
#define NLM_CONNECTIVITY_IPV4_INTERNET 0x0040
pType := IF(pType==NIL,"I",UPPER(pType))
oNLM:= CreateObject( CLSID_NetworkListManager )
IF pType == "I"
lConnected := oNLM:IsConnectedToInternet()
ELSEIF pType == "N"
lConnected := oNLM:IsConnected()
ENDIF
oNLM:destroy()
RETURN lConnected
Regards... Jonathan
Re: I can know if there is a network connection on a PC
InternetGetConnectedState works fine with Xbase++.
There's an eXpress++ sample in \exp20\samples\taskbar\taskbar.prg.
There's an eXpress++ sample in \exp20\samples\taskbar\taskbar.prg.
The eXpress train is coming - and it has more cars.