[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Marshal Antony

2/7/2004 9:12:00 PM

Hi Chris,
You can use File.GetLastWriteTime to get the date and time the
specified file or directory was last written to.
In C# for eg:
string file_path=@"c:\test\yourfile.txt";
DateTime dt=File.GetLastWriteTime(file_path);

In VB.NET
Dim file_path As String = "c:\test\yourfile.txt"

Dim dt As DateTime = File.GetLastWriteTime(file_path)

If you want to set the last write time to
some date and time you want :
For Eg:
In C#
File.SetLastWriteTime(file_path, DateTime.Now);
In VB.NET
File.SetLastWriteTime(file_path, DateTime.Now)
This will update the last write time to the current
time.

Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetm...









"Chris Strobel" <strobelc@kubota-kma.com> wrote in message
news:uSzi7026DHA.360@TK2MSFTNGP12.phx.gbl...
> Is there a way using the Input Type=File and ASP.NET to keep the original
> date and time stamp of files I'm uploading? If not, what about getting the
> original date and time stamps and changing them after the file is uploaded
> to the server?
>
> Thanks,
> Chris
>
>