Google Posted September 13, 2009 at 01:00 AM Report Share #286704 Posted September 13, 2009 at 01:00 AM Boas Tenho um programa que é dependente da Internet para funcionar logo necessito de uma função para verificar se existe ligação há internet ou não. cumps Link to comment Share on other sites More sharing options...
softklin Posted September 13, 2009 at 09:00 AM Report Share #286723 Posted September 13, 2009 at 09:00 AM Uma solução simples (e talvez um pouco rebuscada) pode ser fazer ping a um endereço que supostamente está quase sempre on, por exemplo, o google. Nick antigo: softclean | Tens um projeto? | Wiki P@P Ajuda a comunidade! Se encontrares algo de errado, usa a opção "Denunciar" por baixo de cada post. Link to comment Share on other sites More sharing options...
Google Posted September 13, 2009 at 01:55 PM Author Report Share #286757 Posted September 13, 2009 at 01:55 PM 🙂 Link to comment Share on other sites More sharing options...
softklin Posted September 13, 2009 at 01:57 PM Report Share #286758 Posted September 13, 2009 at 01:57 PM Queres explicar melhor a tua resposta Google? Não percebi. Nick antigo: softclean | Tens um projeto? | Wiki P@P Ajuda a comunidade! Se encontrares algo de errado, usa a opção "Denunciar" por baixo de cada post. Link to comment Share on other sites More sharing options...
Google Posted September 13, 2009 at 02:35 PM Author Report Share #286765 Posted September 13, 2009 at 02:35 PM Obrigado 😄 Deste-me uma ideia 🙂 Link to comment Share on other sites More sharing options...
Pwyll Posted September 13, 2009 at 05:03 PM Report Share #286789 Posted September 13, 2009 at 05:03 PM http://www.dotnetspider.com/resources/6140-Internet-ConnectionStatus-NetworkConnection-Ty.aspx Link to comment Share on other sites More sharing options...
scorch Posted September 13, 2009 at 08:58 PM Report Share #286837 Posted September 13, 2009 at 08:58 PM Google, marca o tópico como resolvido. 😉 PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum. Link to comment Share on other sites More sharing options...
ribeiro55 Posted September 14, 2009 at 12:16 AM Report Share #286884 Posted September 14, 2009 at 12:16 AM Existem API do Win onde podes ir buscar essa informação (como aliás alguém já pesquisou no teu nick, com toda a certeza). Alternativamente podes utilizar a ideia do ping sem precisar de fugir da nossa beloved framework: Public Class Form1 Private WithEvents NW As New Net.NetworkInformation.Ping Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load NW.SendAsync("www.google.com", Nothing) End Sub Private Sub NW_PingCompleted(ByVal sender As Object, ByVal e As System.Net.NetworkInformation.PingCompletedEventArgs) Handles NW.PingCompleted Try MsgBox(e.Reply.Status.ToString) Catch MsgBox("oh, oh") End Try End Sub End Class É melhor trabalhares com o assíncrono para não empanares a aplicação. Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now