I want to check if the image is present or not in a particular Link
Eg :
my link is http://IPaddress/FolderName/imageName.jpg
i want to check if the image is present in this ip address or not using C#.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Guest UserRank #259 · 9.8K reputationPosted Jul 14, 2014, 4:52 AM EDT
HttpWebResponse response = null; var request = (HttpWebRequest)WebRequest.Create("http://IPaddress/FolderName/imageName.jpg"); request.Method = "HEAD"; try { response = (HttpWebResponse)request.GetResponse(); } catch (WebException ex) { /* A WebException will be thrown if the status of the response is not `200 OK` */ } finally { // Don't forget to close your response. if (response != null) { response.Close() } }Guest UserRank #259 · 9.8K reputationPosted Jul 14, 2014, 4:53 AM EDT
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 14, 2014, 10:54 AM EDT
Please try in this way
Suresh MRank #171 · 14K reputationPosted Jul 15, 2014, 9:20 PM EDT
Guest UserRank #259 · 9.8K reputationPosted Jul 15, 2014, 9:25 PM EDT
Suresh MRank #171 · 14K reputationPosted Jul 15, 2014, 9:37 PM EDT
the image link show like this http://IPaddress/login.aspx?%FolderName%/ImageNAme.jpg