If CheckLink("www.hastalavistababytrolollthiswebsiteshouldnotbeexisting.com/super.html") = False then : msgbox("This link is dead ;(") : Else : Msgbox("This link isn't dead! hurray")
and add this code piece inside the Public Class Form1, end class
Private Function CheckLink(ByVal Address as String) as Boolean
Try
my.computer.network.ping(Address)
catch ex as exception
Return False
end try
return true
End function
YES, fixed D:
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 3:58 pm
by Axel
kinda good idea i made a library a while ago but i quitted vb this would be a good idea for a library...
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 4:48 pm
by Adroxxx
Did I do something wrong?
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 4:49 pm
by Axel
Adroxxx wrote:
Did I do something wrong?
you forgot the address
so you need to do "Checklink("http:/www.codenstuff.com")"
thats why i love "ByVal"
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 4:55 pm
by bisnes_niko
Woopsie... My bad did this too fast :o
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 5:05 pm
by Adroxxx
It always says that my link is dead even if my link isnt cryer;
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 5:12 pm
by mandai
You don't use Ping on a HTTP URL.
Use WebClient.DownloadData, if there is an error you can catch it in an exception.
Re: Dead Link Checker
Posted: Wed Sep 08, 2010 5:13 pm
by Axel
Adroxxx wrote:It always says that my link is dead even if my link isnt cryer;