RE: check if image or file exists



Not tested but you could try something like this:

Dim objResponse As Net.HttpWebResponse
Dim objRequest As Net.HttpWebRequest = Net.WebRequest.Create(URL)
objRequest.Method = "GET"
objResponse = objRequest.GetResponse()


"Filip De Backer" wrote:

> Hi everyone,
>
> I want to check if a certain file or image exists.
> The picture exists when I use th eurl in my IE, but in my C# code, the if
> statement returns false.
> Is there another way to do this?
>
> string PictureUrl =
> "http://www.lessius-ho.be/webapp/personeelsindex/images/543.jpg";;
> if (File.Exists(PictureUrl))
> {
> imgFotoPersoon.ImageUrl = PictureUrl;
> imgFotoPersoon.Visible = true;
> }
> else
> {
> imgFotoPersoon.Visible = false;
> }
>
> thanks in advance,
>
> Filip De Backer
.