mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
问题解决工具: 删除开机启动
This commit is contained in:
parent
539db25af7
commit
cfbc7c64bd
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@ -13,5 +14,24 @@ namespace VPet.Solution
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,11 @@ namespace VPet.Solution
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
if (App.IsDone)
|
||||
{
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
@ -116,10 +116,6 @@
|
||||
<Project>{dcad838a-1a02-4bdf-962c-fd47c6006d28}</Project>
|
||||
<Name>VPet-Simulator.Windows.Interface</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\VPet-Simulator.Windows\VPet-Simulator.Windows.csproj">
|
||||
<Project>{b5c2dd17-735f-4f9f-82e4-b8692aec03f1}</Project>
|
||||
<Name>VPet-Simulator.Windows</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user