Dead Link Checker
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Well, I use
On load;
On load;
Code: Select all
and add this code piece inside the Public Class Form1, end class
If CheckLink("www.hastalavistababytrolollthiswebsiteshouldnotbeexisting.com/super.html") = False then : msgbox("This link is dead ;(") : Else : Msgbox("This link isn't dead! hurray")
Code: Select all
YES, fixed D: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
Last edited by bisnes_niko on Wed Sep 08, 2010 4:55 pm, edited 1 time in total.
kinda good idea i made a library a while ago but i quitted vb
this would be a good idea for a library...

Adroxxx wrote:you forgot the address
Did I do something wrong?
so you need to do "Checklink("http:/www.codenstuff.com")"
thats why i love "ByVal"

You don't use Ping on a HTTP URL.
Use WebClient.DownloadData, if there is an error you can catch it in an exception.
Use WebClient.DownloadData, if there is an error you can catch it in an exception.
Adroxxx wrote:It always says that my link is dead even if my link isnt cryer;cuz u returned true ?
maybe you should change the "try" a little bit
Code: Select all
Try
my.network.ping(adress)
return true
catch ex as exception
Msgbox(ex.message)
return false
end try
Things you dont want to happen, happens when you do the thing too fast :S
Copyright Information
Copyright © Codenstuff.com 2020 - 2023