using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Text; using System.Threading; using System.Windows.Forms; using DevExpress.Data.Utils; using DevExpress.XtraSplashScreen; namespace NewArchivesCenter { public partial class SplashScreen1 : SplashScreen { public SplashScreen1() { InitializeComponent(); this.labelCopyright.Text = "© 2018-" + DateTime.Now.Year.ToString() + " LYKNS Corp. 保留部分权利。"; } #region Overrides public override void ProcessCommand(Enum cmd, object arg) { base.ProcessCommand(cmd, arg); } #endregion private void SplashScreen1_Shown(object sender, EventArgs e) { NewArchivesCenter.Properties.Settings.Default.selectedYText = null; NewArchivesCenter.Properties.Settings.Default.selectedMText = null; NewArchivesCenter.Properties.Settings.Default.selectedDText = null; NewArchivesCenter.Properties.Settings.Default.Islogin = false; NewArchivesCenter.Properties.Settings.Default.NewPageType = 0; if (Directory.Exists(Path.GetTempPath() + @"ArchivesCenter\Data\")) { DeleteFolderWithAdminRights.DeleteFolder(Path.GetTempPath() + @"ArchivesCenter"); } if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\ArchivesCenter")) Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\ArchivesCenter"); if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\ArchivesCenter\Backups")) Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\ArchivesCenter\Backups"); //Delay(5000); if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\ArchivesCenter\Users.encrypted")) { register register = new register(); register.Show(); register.Focus(); this.Hide(); } else { login login = new login(); login.Show(); login.Focus(); this.Hide(); } } public static void Delay(int milliSecond) { int start = Environment.TickCount; while (Math.Abs(Environment.TickCount - start) < milliSecond) { Application.DoEvents(); } } public enum SplashScreenCommand { } } }