// store hidden information to hidden file // Date,DaysToEnd,HowManyTimesRuned,BaseString(ComputerID) private void MakeHideFile() { string HideInfo; HideInfo = DateTime.Now.Ticks + ";"; HideInfo += _DefDays + ";" + _Runed + ";" + _BaseString; FileReadWrite.WriteFile(_HideFilePath, HideInfo); }
// store hidden information to hidden file // Date,DaysToEnd,HowManyTimesRuned,BaseString(ComputerID) private void MakeHideFile() { string HideInfo; _LastRun = DateTime.Now.Ticks.ToString(); HideInfo = DateTime.Now.Ticks + ";"; HideInfo += _DefDays + ";" + _BaseString + ";" + _LastRun; FileReadWrite.WriteFile(_HideFilePath, HideInfo); }
private void UpdateHideFile() { string[] HideInfo; string UpdatedInfo; HideInfo = FileReadWrite.ReadFile(_HideFilePath).Split(';'); _LastRun = DateTime.Now.Ticks.ToString(); UpdatedInfo = HideInfo[0] + ";"; UpdatedInfo += HideInfo[1] + ";" + _BaseString + ";" + _LastRun; FileReadWrite.WriteFile(_HideFilePath, UpdatedInfo); }
private void ModifyTimeStampFile() { string TSFileName = Path.GetDirectoryName(_HideFilePath) + "\\TS" + _SoftName + ".tsmp"; string FileContents = string.Empty; if (File.Exists(TSFileName)) { FileContents = FileReadWrite.ReadFile(TSFileName); } FileContents += DateTime.Now.Ticks + ","; FileReadWrite.WriteFile(TSFileName, FileContents); }
/// <summary> /// Show registering dialog to user /// </summary> /// <returns>Type of running</returns> public RunTypes ShowDialog() { // check if registered before if (_IsSubscrip == true) { _Runed = 50; if (DaysToEnd() > 0 && CheckRegister() == true) { return(RunTypes.Full); } else if (CheckRegister() == true) { _Identifier = ""; FileReadWrite.WriteFile(_RegFilePath, ""); MessageBox.Show("Your subscription is expired, Please enter new Subcription ID ", "Password", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { if (CheckRegister() == true) { return(RunTypes.Full); } } frmDialog PassDialog = new frmDialog(_BaseString, _Password, DaysToEnd(), _Runed, _Text, _UID, _IsSubscrip); MakeHideFile(); DialogResult DR = PassDialog.ShowDialog(); if (DR == System.Windows.Forms.DialogResult.OK) { MakeRegFile(); return(RunTypes.Full); } else if (DR == DialogResult.Retry) { return(RunTypes.Trial); } else { return(RunTypes.Expired); } }
// store hidden information to hidden file // Date,DaysToEnd,HowManyTimesRuned,BaseString(ComputerID) private void MakeHideFile(bool isFirstTimeCreation = false) { string HideInfo = string.Empty; if (isFirstTimeCreation) { HideInfo = DateTime.Now.Ticks + ";"; HideInfo += _DefDays + ";" + _Runed + ";" + _BaseString; HideInfo += ";" + DateTime.Now.Add(TimeSpan.FromDays(_DefDays)).Ticks; FileReadWrite.WriteFile(_HideFilePath, HideInfo); } else { //first read the contents of the file string fileContents = FileReadWrite.ReadFile(_HideFilePath); // then keep the installation ticks and license expiration ticks constant string[] HideInfoParts = fileContents.Split(';'); HideInfo = HideInfoParts[0] + ";"; HideInfo += _DefDays + ";" + _Runed + ";" + _BaseString; HideInfo += ";" + HideInfoParts[4]; FileReadWrite.WriteFile(_HideFilePath, HideInfo); } }
// save password to Registration file for next time usage private void MakeRegFile() { FileReadWrite.WriteFile(_RegFilePath, _Password); }