Jump to content

Recommended Posts

  • 1 year later...
Posted

Esse código é muito simples!

1º tens que te conectar ao host em questão,e podes faze-lo por IP ou por URL

2º Se foi estabelecida conexão, então é porque o host esta online.

3º Podes ainda enviar um request HTTP e por exemplo verificar se a lagura de banda do site foi excedida pesquisando por Strings como "This website has execeded the Bandwitch".

“Quanto mais aprendo, mais me dou conta da minha ignorância.” Albert Einstein

Posted

Bom em vb.net é muito simples

     If My.Computer.Network.IsAvailable Then

            Try

                If My.Computer.Network.Ping("http://www.portugal-a-programar.org") Then

                    MsgBox("O site está on.")

                Else

                    MsgBox("O site está off.")

                End If

            Catch ex As Exception

                MsgBox(ex.Message)

            End Try

        Else

            MsgBox("Não há rede!")

        End If

Melhores cumprimentos,João Lopes***Esta mensagem foi escrita ao abrigo do novo Acordo Ortográfico***

  • 1 month later...
Posted

Bom em vb.net é muito simples

     If My.Computer.Network.IsAvailable Then

            Try

                If My.Computer.Network.Ping("http://www.portugal-a-programar.org") Then

                    MsgBox("O site está on.")

                Else

                    MsgBox("O site está off.")

                End If

            Catch ex As Exception

                MsgBox(ex.Message)

            End Try

        Else

            MsgBox("Não há rede!")

        End If

este é um dos motivos pela qual muitas pessoas usam .net a sua utilização neste tipo de casos e muito facil 😞

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.