Skip to content

Commit

Permalink
aaa
Browse files Browse the repository at this point in the history
  • Loading branch information
cornradio committed Jul 25, 2024
0 parents commit 7f68416
Show file tree
Hide file tree
Showing 22 changed files with 2,208 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.vs
25 changes: 25 additions & 0 deletions apex runner.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35013.160
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "apex runner", "apex runner\apex runner.csproj", "{23180AD2-D98C-42F0-9C3D-96A741C6CE58}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{23180AD2-D98C-42F0-9C3D-96A741C6CE58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23180AD2-D98C-42F0-9C3D-96A741C6CE58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23180AD2-D98C-42F0-9C3D-96A741C6CE58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23180AD2-D98C-42F0-9C3D-96A741C6CE58}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D3189C35-3D5F-41F3-9007-E748FE264858}
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions apex runner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/bin
/obj
18 changes: 18 additions & 0 deletions apex runner/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="apex_runner.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<userSettings>
<apex_runner.Properties.Settings>
<setting name="uupath" serializeAs="String">
<value>C:\Program Files (x86)\Netease\UU\launcher.exe</value>
</setting>
</apex_runner.Properties.Settings>
</userSettings>
</configuration>
315 changes: 315 additions & 0 deletions apex runner/Form1.Designer.cs

Large diffs are not rendered by default.

177 changes: 177 additions & 0 deletions apex runner/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static WindowsKey;
using static InputMethod;
using System.Diagnostics;
using System.Threading;
using System.IO;
using apex_runner.Properties;
using System.Security.Policy;


namespace apex_runner
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
//获取当前输入法状态并且标识
if(InputMethod.CurrentMethod() == InputMethodType.Chinese)
{
radioButton_chinese.Checked = true;
}
else
{
radioButton_eng.Checked = true;
}
//获取设置中的 uu 加速器路径
textBox1.Text = Settings.Default.uupath;

}


//禁用 Windows 键功能
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if (radioButton2.Checked == true)
{
WindowsKey.Disable();
}
else
{
WindowsKey.Enable();
}
}

//切换英文输入法功能
private void radioButton_eng_CheckedChanged(object sender, EventArgs e)
{
if (radioButton_eng.Checked == true)
{
InputMethod.ChangeToEnglish();
}
else
{
InputMethod.ChangeToChinese();
}
}

//手抖多点出来的,懒得删了
private void label4_Click(object sender, EventArgs e)
{

}

private void label1_Click(object sender, EventArgs e)
{

}

//开启加速器 图片按钮
private void pictureBox2_Click(object sender, EventArgs e)
{
string path = textBox1.Text;
StartProgram(path);
}

//一键优化 开启游戏模式
private void button1_Click(object sender, EventArgs e)
{
radioButton2.Checked = true;
radioButton_eng.Checked = true;
}

//一键恢复 开启正常电脑模式
private void button2_Click(object sender, EventArgs e)
{
radioButton1.Checked = true;
radioButton_chinese.Checked = true;
}

//textbox1 在修改时自动保存加速器路径
private void textBox1_TextChanged(object sender, EventArgs e)
{
Settings.Default.uupath = textBox1.Text;
Settings.Default.Save();
}

//右下关于按钮
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show($"这个程序是免费的\n如果你感觉这个程序有帮助的话\n" +
$"我希望你们可以去 github 帮我点星星\n---\n" +
$"这个程序其实主要都是Chat-GPT 写的\n" +
$"有时候我得承认\n" +
$"他写的代码确实比我写的质量好多了\n" +
$":P");
}

//右下角链接
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
OpenUrl("https://github.com/cornradio");
}

//用于启动加速器的启动函数
static void StartProgram(string path)
{
if (!File.Exists(path))
{
MessageBox.Show("程序路径不存在或无法启动,请检查路径是否正确。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

try
{
// 创建一个新的进程启动信息
ProcessStartInfo startInfo = new ProcessStartInfo(path)
{
UseShellExecute = false,
CreateNoWindow = true
};

// 启动程序
Process process = Process.Start(startInfo);

// 模拟双击的延迟
Thread.Sleep(200); // 200毫秒的延迟

// 再次启动程序
Process.Start(startInfo);
}
catch (Exception ex)
{
MessageBox.Show("无法启动程序:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
//用于开启网页链接的函数
static void OpenUrl(string url)
{
try
{
ProcessStartInfo startInfo = new ProcessStartInfo
{
FileName = url,
UseShellExecute = true
};
Process.Start(startInfo);
}
catch (Exception ex)
{
Console.WriteLine("无法打开URL:" + ex.Message);
}
}
}
}
Loading

0 comments on commit 7f68416

Please sign in to comment.