By web app, you mean a windows app that works with the web ? Your app is not ASP.NET, right ? ninjatruck wrote: I am new to C#, This is an odd task for someone who is 'new to C#'. How new is new ? What other languages do you know ? Why are you writing this right now ?
I think it should be always better to ping the server rather than practically loading the page. The site sometimes throws error if proper login to the url is not there. So Please take out the part after the url and ping that. For instance http: // www.amazon.com/exec/obidos/ASIN/B000GELXHY should be placed as http: // www.amazon.com Hope this is working.
Well my plan is to use this as part of the code behind class for an ASP.NET website. I know c++, though I'm not very experienced with that either. I'm writing this now to help a friend who wants this for work. The program will read a .csv, and check URLs based on what it reads. I have everything else working great, but checking the URL isn't working correctly. I've only been working with c# for...
ninjatruck wrote: see if a given URL is valid that depends on your definition of valid, e.g.: - responding to pings; - responding to HTML GET; - responding to HTML POST; - responding to other protocols; ...
ninjatruck wrote: Well my plan is to use this as part of the code behind class for an ASP.NET website. Why would an ASP.NET site be checking if other sites are valid ? ninjatruck wrote: I know c++, though I'm not very experienced with that either. I'm writing this now to help a friend who wants this for work. Wait - you don't really know C# or C++, or any other language, but you're ...
It is very hard to make. If you PING to server, you can easly get if the server is accsasible. But as i understand from your original post, you wan't to make sure a link is valid not if server is accsasible. Here the problem rises. Server is easly visible, but it will return a custom 404 page. If you wan't to make for specific sites, you can grab all those sites their custom 404 pages, parse it...
Read his answer above. He's been doing C# for a month and that month gives him more experience than a friend who works as a programmer, so he's trying to help him out.
ninjatruck wrote: Honestly I didn't realize this was such a complicated task when I said I would help. Fair enough - you're doing a cool thing to try to help a friend, I am just shocked that based on your limited experience, that he both needs your help, and has a job as a developer.
It is very hard to make. If you PING to server, you can easly get if the server is accsasible. But as i understand from your original post, you wan't to make sure a link is valid not if server is accsasible. Here the problem rises. Server is easly visible, but it will return a custom 404 page. If you wan't to make for specific sites, you can grab all those sites their custom 404 pages, parse it and check its content.
I think it should be always better to ping the server rather than practically loading the page. The site sometimes throws error if proper login to the url is not there. So Please take out the part after the url and ping that. For instance http: // www.amazon.com/exec/obidos/ASIN/B000GELXHY should be placed as http: // www.amazon.com Hope this is working.
Related threads on "CodeProject: Discussion Boards. Free source code and programming help":
Thread profile page for "[Message Deleted]" on http://www.codeproject.com.
This report page is a snippet summary view from a single thread "[Message Deleted]", located on the Message Board at http://www.codeproject.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity