RE: check if image or file exists
- From: "Harolds" <Harolds@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 22 Jun 2005 08:52:01 -0700
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
.
- Follow-Ups:
- Re: check if image or file exists
- From: oraclevsmicrosoft
- Re: check if image or file exists
- References:
- check if image or file exists
- From: Filip De Backer
- check if image or file exists
- Prev by Date: RE: View DataSet Relational Data
- Next by Date: Re: Programmatically changing CssStyle on Panels depending on DB values
- Previous by thread: check if image or file exists
- Next by thread: Re: check if image or file exists
- Index(es):