public static string CreateNewCard(string CardGroup) { try { string dir = GetExecutablePath(); dir += @"Cards\"; dir += CardGroup + @"\"; dir += "C" + GetDateTimeStamp() + @"\"; if (Directory.Exists(dir) == false) { Directory.CreateDirectory(dir); } string history = string.Format("[{0}] Created. Stage: 0", Globals.GetDateTimeStampSec()); File.WriteAllText(string.Format("{0}history.txt", dir), history); DateTime now = DateTime.Now; MultiCalendar mc = new MultiCalendar(); mc.SetGregDate(now.Year, now.Month, now.Day); mc.SetTime(now.Hour, now.Minute, now.Second); double gdp = mc.GetGdp(); KeyValPair kvp = new KeyValPair(';', ':'); kvp.Add("next_visit", (gdp + 1).ToString()); kvp.Add("next_visit_jal", mc.GetJalDate(DateSeparator: "") + "-" + mc.GetTime(TimeSeparator: "")); kvp.Add("next_visit_grg", mc.GetGregDate(DateSeparator: "") + "-" + mc.GetTime(TimeSeparator: "")); kvp.Add("stage", "0"); kvp.Add("can_edit", "1"); kvp.Add("last_modified", gdp.ToString()); kvp.Add("crc", "0"); string manifest_data = kvp.GetStrLines(); //manifest_data += string.Format("next_visit={0}\r\n", gdp); //manifest_data += string.Format("stage={0}\r\n", 0); //manifest_data += string.Format("can_edit={0}\r\n", 1); //manifest_data += string.Format("last_modified={0}\r\n", gdp); //manifest_data += string.Format("crc={0}\r\n", 0); File.WriteAllText(string.Format("{0}manifest.man", dir), manifest_data); return(dir); } catch { return(""); } }