public void SaveKeyData(string filePath, string pattern) { try { string keyFile; //if (filePath.LastIndexOf(@"\") == filePath.Length - 1) //{ // keyFile = filePath + FileName; //} //else //{ // keyFile = filePath + @"\" + FileName; //} keyFile = filePath + FileName; StreamWriter sw = new StreamWriter(keyFile, false); string dtValue = Convert.ToString(LastUpdateDate.Ticks, 16); string key_date = RegKey.Trim().ToUpper() + pattern + dtValue.ToUpper(); sw.WriteLine(key_date); sw.Close(); } catch (Exception ex) { throw ex; } }