We’re hosting SSIS reports on our servers and we are storing their paths in a sql server table. From .Net, I want to be able to make sure the path entered is correct.
This should return “true” because there’s a report there, for example:
http://server/Reports/Pages/Viewer.aspx?%2fShopFloor%2fProduction+by+Turn&rs:Command=Render
This should return false.
http://I am an invalid location/I am laughing at you/now I'm UEEing
I was looking at WebRequests, but I don’t know if that’s the route I should be taking.
Any help would be appreciated. Thanks!
Do a http
HEADrequest to the URL, which should just fetch headers. This way you dont need to download the entire page if it exists. from the returned headers(if there are any) you should be able to determine if its a correct URL or not.