You certainly won't be able to use File-based calls to determine the date
time of 'some resource' on a Web server. It's not a file, as far as
anything on the Windows CE device knows. It's not even a 'what' that the
File class understands. It's just a URL not a reference to a file in a
real, local filesystem.
There may be some method that you could use to query the Web server for the
date of that item. In particular, I'm thinking that creating an
HttpWebRequest instance and setting the IfModifiedSince property to the date
you care about and arranging the rest of the request to get the target item
might do what you need. You'd have to handle treating the response to your
request (it might contain a file or nothing, depending on the date), and
writing the file.
Paul T.
[quoted text, click to view] <patrick.roy@tech-nter.com> wrote in message
news:3710ca63-4fa3-4f5b-b204-a25001cf7345@e25g2000prg.googlegroups.com...
> Hi,
>
> I would like to "GetLastWriteTime" of a file that is located on my IIS
> server without having to download it.
>
> My goal is to download the file ONLY if the file is more recent on
> IIS.
>
> He're my code :
>
> localFileName = string.Format(@"{0}{1}\{2}", localSyncPath,
> ApplicationFolder.Help, line);
> url = string.Format("http://{0}/ATMP/{1}/{2}", serverIPAddress,
> IISHelpPath, line);
>
> if (File.GetLastWriteTime(localFileName) < File.GetLastWriteTime(url))
> {
> NetworkUtil.DownloadFile(url, localFileName);
> }
>
> When I run that code, I got an error because the function
> File.GetLastWriteTime(url) does'nt seems to accept url file like
> "
http://10.121.128.16/ATMP/Help/1Options.htm".
> The exact error is (in french) : "La valeur n'est pas comprise dans la
> plage attendue."
> Translated in english, it should sounds like "Value is not included in
> planned range"... Sorry for my bad translation :-)
>
> Also, the Stacktrace start by : at
> System.IO.Path.GetFullPathInternal() at
> System.IO.File.GetLastWriteTime() at ...
>
> Thank you.