K Keith Smith Mar 8, 2005 #1 I would like to get the last run date of a file called "scale.txt". How would I do that?
G Glenn Mar 8, 2005 #2 Keith Take a look at the System.IO.FileInfo object, this should give you the last access time and last write time information. HTH Glenn
Keith Take a look at the System.IO.FileInfo object, this should give you the last access time and last write time information. HTH Glenn
G Guest Mar 8, 2005 #3 You could use FileInfo FileInfo fi = new FileInfo("scale.txt"); this.textBox1.Text = fi.LastAccessTime.ToString(); that should get you a string looking like this: "2005-03- 08 14:23:47" don't forget to include System.IO /Johan
You could use FileInfo FileInfo fi = new FileInfo("scale.txt"); this.textBox1.Text = fi.LastAccessTime.ToString(); that should get you a string looking like this: "2005-03- 08 14:23:47" don't forget to include System.IO /Johan
Y Yonas hagos Mar 8, 2005 #4 Keith: using System.IO FileInfo MyFile as new FileInfo("c:\\scale.txt") ; string Staccess = MyFile.LastAccessTime.ToString() ; string Strcreation = MyFile.creationTime.ToString(); string Strmodified = MyFile.modifiedTime.ToString(); Hope this helps Yonas
Keith: using System.IO FileInfo MyFile as new FileInfo("c:\\scale.txt") ; string Staccess = MyFile.LastAccessTime.ToString() ; string Strcreation = MyFile.creationTime.ToString(); string Strmodified = MyFile.modifiedTime.ToString(); Hope this helps Yonas
K Keith Smith Mar 8, 2005 #5 using System.IO FileInfo MyFile as new FileInfo("c:\\scale.txt") ; string Staccess = MyFile.LastAccessTime.ToString() ; string Strcreation = MyFile.creationTime.ToString(); string Strmodified = MyFile.modifiedTime.ToString(); Hope this helps Yonas Click to expand... Yonas, thanks for your clear answer.
using System.IO FileInfo MyFile as new FileInfo("c:\\scale.txt") ; string Staccess = MyFile.LastAccessTime.ToString() ; string Strcreation = MyFile.creationTime.ToString(); string Strmodified = MyFile.modifiedTime.ToString(); Hope this helps Yonas Click to expand... Yonas, thanks for your clear answer.
K Keith Smith Mar 8, 2005 #6 For those interested....I had to make a small correction on the second line...