P
patrick.roy
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.
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.