PC Review


Reply
Thread Tools Rate Thread

check if a file exists on a web server

 
 
Jane
Guest
Posts: n/a
 
      30th Dec 2003
Hello,

I am developing a windows service application that checks
if a particular web page is on the web server. I found
there is a method called File.exists(path) to check it,
but how can I get absolute path of a web page in a windows
application rather than a web application? In a web
application, we can use Server.MapPath(mypath) to get
absolute path.

Thanks in advance.

Jane
 
Reply With Quote
 
 
 
 
Russ Green
Guest
Posts: n/a
 
      30th Dec 2003
This funtion should do the trick

Private Function FileExists(ByVal strFileName As String) As Boolean
Dim FileFound As String

On Error GoTo 0
FileFound = Dir(strFileName)
If Len(FileFound) = 0 Then
FileExists = False
Else
FileExists = True
End If
End Function

HTH

Russ

"Jane" <(E-Mail Removed)> wrote in message
news:019f01c3cf07$5c8e82b0$(E-Mail Removed)...
> Hello,
>
> I am developing a windows service application that checks
> if a particular web page is on the web server. I found
> there is a method called File.exists(path) to check it,
> but how can I get absolute path of a web page in a windows
> application rather than a web application? In a web
> application, we can use Server.MapPath(mypath) to get
> absolute path.
>
> Thanks in advance.
>
> Jane



 
Reply With Quote
 
Jeff B.
Guest
Posts: n/a
 
      30th Dec 2003
I don't know the actual source code to use right off hand (too lazy to try
it out :-) However, check out the HttpWebRequest class. I've seen this
class used in other examples to test for the existence of a web page given a
URL to test (e.g. http://www.mydomain.com/somefile.html).

--
Thanks, Jeff

"Jane" <(E-Mail Removed)> wrote in message
news:019f01c3cf07$5c8e82b0$(E-Mail Removed)...
> Hello,
>
> I am developing a windows service application that checks
> if a particular web page is on the web server. I found
> there is a method called File.exists(path) to check it,
> but how can I get absolute path of a web page in a windows
> application rather than a web application? In a web
> application, we can use Server.MapPath(mypath) to get
> absolute path.
>
> Thanks in advance.
>
> Jane



 
Reply With Quote
 
Russ Green
Guest
Posts: n/a
 
      31st Dec 2003
Take a look at this little project. It way help
http://www.russgreen.net\software\do...iveUpdater.zip

Russ


"Jane" <(E-Mail Removed)> wrote in message
news:019f01c3cf07$5c8e82b0$(E-Mail Removed)...
> Hello,
>
> I am developing a windows service application that checks
> if a particular web page is on the web server. I found
> there is a method called File.exists(path) to check it,
> but how can I get absolute path of a web page in a windows
> application rather than a web application? In a web
> application, we can use Server.MapPath(mypath) to get
> absolute path.
>
> Thanks in advance.
>
> Jane



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if file exists on FTP server? Richard Edwards Microsoft Excel Programming 1 24th Feb 2009 08:28 PM
How to check whether a folder exists in FTP server? thomasc Microsoft VB .NET 0 23rd Feb 2009 12:30 PM
Check if a file exists on a remote server Mr.Dicker Microsoft Windows 2000 1 16th Aug 2006 04:23 PM
Check if File exists Ricardo Luceac Microsoft C# .NET 10 23rd Jan 2006 02:41 PM
Check a file exists? andycharger Microsoft Excel Programming 2 10th Mar 2004 12:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:29 AM.