|
-
Jun 22nd, 2004, 10:06 AM
#1
Thread Starter
Member
How to get the application last compiled date? [Resolved]
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?
Last edited by Genie; Jun 23rd, 2004 at 05:35 AM.
-
Jun 23rd, 2004, 02:35 AM
#2
Sleep mode
-
Jun 23rd, 2004, 03:04 AM
#3
Fanatic Member
hello mate. i've got an exception error of URI formats are not supported.. am i missing something? thanx...
-
Jun 23rd, 2004, 03:15 AM
#4
Fanatic Member
got it mate. sorry for bothers.
PHP Code:
System.IO.FileInfo fi=new System.IO.FileInfo(
Environment.CurrentDirectory+@"\ConsoleApplication14.exe");
Console.WriteLine(fi.LastWriteTime.ToLongDateString().ToString());
thanks
-
Jun 23rd, 2004, 03:33 AM
#5
Sleep mode
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());
-
Jun 23rd, 2004, 03:45 AM
#6
Fanatic Member
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
-
Jun 23rd, 2004, 05:21 AM
#7
Thread Starter
Member
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.
-
Jun 23rd, 2004, 10:40 AM
#8
Sleep mode
Originally posted by Genie
Application.ExecutablePath seems to give you the complete path including exe name.
Thanks.
oops . I don't know how I missed this one...
-
Jun 23rd, 2004, 07:45 PM
#9
Fanatic Member
gee... thanks
-
Jun 26th, 2004, 02:22 PM
#10
yay gay
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?
\m/  \m/
-
Jun 26th, 2004, 04:01 PM
#11
Sleep mode
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?
public DateTime LastWriteTime {get; set;}
Gets or sets the time when the current file or directory was last
written to.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|