Josh streit
Josh streit

Reputation: 207

Check If Remote File Exists

In vb.net (using vs2005), I'd like to see if www.domain.com/myfile.txt exists.

Thanks in advance!

Upvotes: 1

Views: 2008

Answers (2)

JP Alioto
JP Alioto

Reputation: 45117

Assuming you can browse to this file, you could use the HTTPWebRequest class and either grab the file and check it or get a 404 error.

Upvotes: 2

Joel Coehoorn
Joel Coehoorn

Reputation: 415735

The easiest way to access an internet URL is via the System.Net.WebClient class.

Upvotes: 0

Related Questions