I have a C# Windows app and wanted to put a label on the login screen with the last compiled date;
ie. Release Date : 22/06/2004
anyone know if this can be done, and if so what holds the app last compiled date?
Printable View
I have a C# Windows app and wanted to put a label on the login screen with the last compiled date;
ie. Release Date : 22/06/2004
anyone know if this can be done, and if so what holds the app last compiled date?
hello mate. i've got an exception error of URI formats are not supported.. am i missing something? thanx...
got it mate. sorry for bothers.
thanksPHP Code:System.IO.FileInfo fi=new System.IO.FileInfo(
Environment.CurrentDirectory+@"\ConsoleApplication14.exe");
Console.WriteLine(fi.LastWriteTime.ToLongDateString().ToString());
Or this way :
PHP Code:string exeName = Assembly.GetExecutingAssembly().GetName().Name;
string exePath = Path.Combine(Application.ExecutablePath ,exeName);
FileInfo fi = new FileInfo(exePath);
DateTime buildDate = fi.LastWriteTime;
MessageBox.Show(buildDate.ToString());
pardon my stupidity mate, but i've got a date way before titanic was built. lol. am i missing something? it says... 1/1/1601 8:00:00 AM. thanks
got it:
string exePath = Application.ExecutablePath;
System.IO.FileInfo fi = new System.IO.FileInfo(exePath);
DateTime buildDate = fi.LastWriteTime;
MessageBox.Show(buildDate.ToString());
Application.ExecutablePath seems to give you the complete path including exe name.
Thanks.:D
oops . I don't know how I missed this one...:cry:Quote:
Originally posted by Genie
Application.ExecutablePath seems to give you the complete path including exe name.
Thanks.:D
:bigyello: gee... thanks
Sorry about the stupidity but if you copy your exe to a ftp or something like that, the lastwritetime will change to the exact moment where the file is created on the other side so the date your program shows might be screwed..or not?
:afrog:
public DateTime LastWriteTime {get; set;}Quote:
Originally posted by PT Exorcist
Sorry about the stupidity but if you copy your exe to a ftp or something like that, the lastwritetime will change to the exact moment where the file is created on the other side so the date your program shows might be screwed..or not?
:afrog:
Gets or sets the time when the current file or directory was last
written to.