My.Computer.Network.Ping & files??

  • Thread starter Thread starter Arthur Dent
  • Start date Start date
A

Arthur Dent

Is there anyway to do something like this, but for an individual file
instead of for a server?
For example, when showing product catalogs, i would like to be able to
"ping" a product
image, and if it is not accessible, then put out a "No Image" file.

TIA - Arthur Dent
 
Is there anyway to do something like this, but for an individual file
instead of for a server?
For example, when showing product catalogs, i would like to be able to
"ping" a product
image, and if it is not accessible, then put out a "No Image" file.

Where are you storing the files?

If it's in a database, it's very easy using ADO.NET - just check if the
datareader or dataset has any data.

If it's on a file system, you can use the System.IO.File classes to
determine if a file exists.

If the file is remote, then you can use the HTTPClient classes - but if you
were to check the exisitence of every file, it could become a performance
issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top