Jump to content
Fivewin Brasil

Verificar Internet


Guest n/a

Recommended Posts

Fala galera

existe algum comando que eu possa saber se o computador

esta ligado a internet ou nao ??

vlw

MSN --[ lailton.webmaster@hotmail.com ]--

FiveWin 8.5 | Xharbour 1.1.0 | BCC55 | C Pelles | Designer.LIB

Link to comment
Share on other sites

Fala galera

existe algum comando que eu possa saber se o computador

esta ligado a internet ou nao ??

vlw

MSN --[ lailton.webmaster@hotmail.com ]--

FiveWin 8.5 | Xharbour 1.1.0 | BCC55 | C Pelles | Designer.LIB

Link to comment
Share on other sites

Bem, eu faço da Seguinte maneira:

IF TemNet()

//Mostrar Fundo como página

EndIf

//Função Adaptada

Function TemNet(cAddress)

Local aHosts, cName

Default cAddress := "www.fivewin.com.br"

InetInit()

aHosts := InetGetHosts(cAddress)

If aHosts == Nil .or. Len(aHosts)=0

InetCleanup()

return .f.

endif

InetCleanup()

Return(.t.)

clipper 5.3d, fw 2.4 / xharb 0.99.70 simplex, fwh 7.05, Pellesc , Work , MySql

Link to comment
Share on other sites

Lailton,

Há algum tempo atrás, passei por essa mesma necessidade e consegui uma boa ajuda no fivetech:

http://forums.fivetechsoft.com/viewtopic.php?t=13296&start=30

--

Júlio César M. Ferreira

www.rsconsultores.com.br

Fone: (81) 4009.5444

Fax: (81) 4009.5400

E-mail: julio.mferreira@gmail.com

MSN: julio_mferreira@hotmail.com

Recife - PE

FWh 8.08/ xHarbour 1.1.0/ xDevStudio 0.72/ SQL LIB 1.9/ Pelles 5.00.1

Link to comment
Share on other sites

FUNCTION ChecaInternet()

LOCAL Value:=0, retval:=0

Value:=0

retval:=""

if !InternetGetConnectedState(@value,0)

if MsgYesNo("Você não Esta Conectado à Internet, Deseja Conectar-se agora ?")

retval:=InternetDial(GetActiveWindow(),,2,@value,0)

if retval<> 0

DO WHILE .T.

retval:=InternetDial(GetActiveWindow(),,2,@value,0)

if retval<> 0

if MsgYesNo("Conexão não disponível, Verifique sua configuração de Internet ou tentar novamente ?")

LOOP

endif

endif

exit

ENDDO

if !Conectado

MsgStop("Conexão não disponível, Verifique sua Configuração da Internet !")

Return(.f.)

endif

endif

else

MsgStop("Conexão não disponível, Verifique sua Configuração da Internet !")

Return(.f.)

endif

endif

Return(.t.)

DLL32 FUNCTION InternetGetConnectedState( @LpDwflags AS PTR, Dwreserve AS LONG) AS BOOL PASCAL LIB "WinINet.dll"

DLL32 FUNCTION InternetDial( Hwnd AS LONG, Cconnect AS LPSTR, Dwflag AS LONG, ;

@Dwconnect AS PTR , Dwreserve AS LONG) AS DWORD ;

PASCAL LIB "WinINet.dll"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...