Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.dotnet.framework.aspnet.webcontrols
Re: File upload date and Time
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
>
>
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: File upload date and Time
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password