How to get the datetime of a file located inside a folder?
Is it possible to 开发者_如何学运维get a datetime of a file which is located inside a folder...
the folder structure is like dotnet\build\portalFlexLib.swc
I need to get the datetime of portalFlexLib.swc
without giving harcore value..
I have tried like this
DateTime ftime = File.GetCreationTime(txtBoxInput.Text);
It give only the folder datetime...Any suggestion??
Maybe you could try with FileInfo class?
Fileinfo myFileInfo = new Fileinfo(@"C:\path\to\file");
DateTime ftime = myFileInfo.CreationTime;
There's the UTC version too;
Datetime ftime = myFileInfo.CreationTimeUtc;
Yes You can do this by file info.
var f= new FileInfo(fileName);
var creationDate = f.CreationTime;
精彩评论