static void GenerateVersionInfo(DateTime now, string file)
{
string version = null;
if (System.IO.File.Exists(file))
{
string[] lines = System.IO.File.ReadAllLines(file);
if (lines.Length > 0 && !String.IsNullOrEmpty(lines[0]))
{
version = lines[0];
}
}
// If the file does not exist, create it.
if (version == null)
{
version = now.ToString("u").Split(' ')[0];
System.IO.File.WriteAllLines(file, new string[] { version });
}
}