VPet/VPet.Solution/App.xaml.cs

38 lines
1.0 KiB
C#
Raw Normal View History

2023-09-11 08:01:44 +00:00
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
2023-09-12 04:51:23 +00:00
using System.IO;
2023-09-11 08:01:44 +00:00
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace VPet.Solution
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
2023-09-12 04:51:23 +00:00
public static bool IsDone { get; set; } = false;
protected override void OnStartup(StartupEventArgs e)
{
if (e.Args != null && e.Args.Count() > 0)
{
IsDone = true;
switch (e.Args[0].ToLower())
{
case "removestarup":
var path = Environment.GetFolderPath(Environment.SpecialFolder.Startup) + @"\VPET_Simulator.lnk";
if(File.Exists(path))
{
File.Delete(path);
}
return;
}
}
IsDone = false;
}
2023-09-11 08:01:44 +00:00
}
}