Click here to Skip to main content
15,891,763 members
Home / Discussions / C#
   

C#

 
AnswerRe: Accessing the default application folder Pin
Tarakeshwar Reddy25-Jun-07 3:41
professionalTarakeshwar Reddy25-Jun-07 3:41 
AnswerRe: Accessing the default application folder Pin
Chintan.Desai25-Jun-07 3:47
Chintan.Desai25-Jun-07 3:47 
GeneralRe: Accessing the default application folder Pin
Ed.Poore25-Jun-07 6:48
Ed.Poore25-Jun-07 6:48 
AnswerRe: Accessing the default application folder Pin
Martin#25-Jun-07 3:59
Martin#25-Jun-07 3:59 
AnswerRe: Accessing the default application folder Pin
Dave Kreskowiak25-Jun-07 4:35
mveDave Kreskowiak25-Jun-07 4:35 
GeneralRe: Accessing the default application folder Pin
led mike25-Jun-07 4:44
led mike25-Jun-07 4:44 
GeneralRe: Accessing the default application folder Pin
Dave Kreskowiak25-Jun-07 5:05
mveDave Kreskowiak25-Jun-07 5:05 
QuestionEfficient way to check if web resource/file exists? Pin
Dominic Pettifer25-Jun-07 2:43
Dominic Pettifer25-Jun-07 2:43 
Whats the best most efficient way of checking whether a resource (image, page, document etc.) exists at a particular URL web address location. Eg. I have a url http://www.example.com/myImage.jpg and I want to check whether myImage.jpg actually exists.

At the moment I'm using the WebClient class like so...

WebClient client = new WebClient();<br />
<br />
try<br />
{<br />
  if(client.Download("http://www.example.com/myImage.jpg").Length > 0)<br />
  {<br />
    // File exists<br />
  }<br />
  else<br />
  {<br />
    // File doesn't exist<br />
  }<br />
}<br />
catch<br />
{<br />
  // File doesn't exist<br />
}


...problem with this method though is that it downloads the entire file to check it's existence. I'm not interested in the file, just whether the server will return a 404 or not.

Cheers!

Dominic Pettifer

Blog: www.dominicpettifer.co.uk

AnswerRe: Efficient way to check if web resource/file exists? [modified] Pin
I.explore.code25-Jun-07 3:25
I.explore.code25-Jun-07 3:25 
GeneralRe: Efficient way to check if web resource/file exists? Pin
User 665825-Jun-07 3:28
User 665825-Jun-07 3:28 
AnswerRe: Efficient way to check if web resource/file exists? Pin
I.explore.code25-Jun-07 19:49
I.explore.code25-Jun-07 19:49 
GeneralRe: Efficient way to check if web resource/file exists? Pin
Dominic Pettifer25-Jun-07 22:03
Dominic Pettifer25-Jun-07 22:03 
Questiondatagrid with row header Pin
Sunshine Always25-Jun-07 2:37
Sunshine Always25-Jun-07 2:37 
QuestionParsing a log file using regular expressions Pin
salon25-Jun-07 2:26
salon25-Jun-07 2:26 
AnswerRe: Parsing a log file using regular expressions Pin
User 665825-Jun-07 3:44
User 665825-Jun-07 3:44 
GeneralRe: Parsing a log file using regular expressions Pin
salon25-Jun-07 4:00
salon25-Jun-07 4:00 
GeneralRe: Parsing a log file using regular expressions Pin
User 665825-Jun-07 4:18
User 665825-Jun-07 4:18 
QuestionWhy causes the change of the Location the change of the size Pin
MarkPhB25-Jun-07 2:24
MarkPhB25-Jun-07 2:24 
Questionhow can I test my FTP application? Pin
Mostafa Siraj25-Jun-07 2:04
Mostafa Siraj25-Jun-07 2:04 
AnswerRe: how can I test my FTP application? Pin
originSH25-Jun-07 2:12
originSH25-Jun-07 2:12 
AnswerRe: how can I test my FTP application? Pin
Carmine_XX25-Jun-07 7:18
Carmine_XX25-Jun-07 7:18 
QuestionT9 dictionary in c# Pin
seeng25-Jun-07 1:43
seeng25-Jun-07 1:43 
AnswerRe: T9 dictionary in c# Pin
Pete O'Hanlon25-Jun-07 1:55
mvePete O'Hanlon25-Jun-07 1:55 
AnswerRe: T9 dictionary in c# Pin
Christian Graus25-Jun-07 2:10
protectorChristian Graus25-Jun-07 2:10 
AnswerRe: T9 dictionary in c# Pin
Pete O'Hanlon25-Jun-07 2:19
mvePete O'Hanlon25-Jun-07 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.