Esempio n. 1
0
 /// <summary>
 /// 重启程序
 /// </summary>
 private void RestartAppClick()
 {
     ProcessUtil.CloseTheseProcess();
     App.AppMainMutex.Dispose();
     ProcessUtil.OpenLink(FileUtil.Current_Path);
     Application.Current.Shutdown();
 }
Esempio n. 2
0
    /// <summary>
    /// 初始化配置文件夹
    /// </summary>
    private void InitCPDPathClick()
    {
        try
        {
            if (MessageBox.Show("你确定要初始化配置文件吗?", "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
            {
                Directory.SetCurrentDirectory(FileUtil.CurrentDirectory_Path);
                ProcessUtil.CloseTheseProcess();
                Thread.Sleep(20);
                FileUtil.DelectDir(FileUtil.Default_Path);

                App.AppMainMutex.Dispose();
                ProcessUtil.OpenLink(FileUtil.Current_Path);
                Application.Current.Shutdown();
            }
        }
        catch (Exception ex)
        {
            MsgBoxUtil.Exception(ex);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// 重命名小助手为中文
    /// </summary>
    private void ReNameAppCNClick()
    {
        try
        {
            string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(FileUtil.Current_Path);
            if (fileNameWithoutExtension != (CoreUtil.MainAppWindowName + CoreUtil.ClientVersionInfo))
            {
                FileUtil.FileReName(FileUtil.Current_Path, FileUtil.GetCurrFullPath(CoreUtil.MainAppWindowName + CoreUtil.ClientVersionInfo + ".exe"));

                ProcessUtil.CloseTheseProcess();
                App.AppMainMutex.Dispose();
                ProcessUtil.OpenLink(FileUtil.GetCurrFullPath(CoreUtil.MainAppWindowName + CoreUtil.ClientVersionInfo + ".exe"));
                Application.Current.Shutdown();
            }
            else
            {
                MsgBoxUtil.Information("程序文件名已经符合中文命名标准,无需继续重命名");
            }
        }
        catch (Exception ex)
        {
            MsgBoxUtil.Exception(ex);
        }
    }
Esempio n. 4
0
    /// <summary>
    /// 重命名小助手为英文
    /// </summary>
    private void ReNameAppENClick()
    {
        try
        {
            string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(FileUtil.Current_Path);
            if (fileNameWithoutExtension != "GTA5OnlineTools")
            {
                FileUtil.FileReName(FileUtil.Current_Path, "GTA5OnlineTools.exe");

                ProcessUtil.CloseTheseProcess();
                App.AppMainMutex.Dispose();
                ProcessUtil.OpenLink(FileUtil.GetCurrFullPath("GTA5OnlineTools.exe"));
                Application.Current.Shutdown();
            }
            else
            {
                MsgBoxUtil.Information("程序文件名已经符合英文命名标准,无需继续重命名");
            }
        }
        catch (Exception ex)
        {
            MsgBoxUtil.Exception(ex);
        }
    }