This commit is contained in:
Dengrb 2024-10-04 16:42:46 +08:00
parent bbf0b48ef0
commit e62d624f68
2 changed files with 40 additions and 22 deletions

View File

@ -2,37 +2,55 @@
#include<string>
#include<windows.h>
#include<cstdlib>
#include"SimpleIni.h"
using namespace std;
void handleUserInput() {
int main() {
//初始化ini文件
CSimpleIniA ini;
ini.SetUnicode();
ini.SetMultiKey(true);
ini.LoadFile("config.ini");
const char* name = ini.GetValue("User","name","0");
std::cout << "欢迎使用CSSO与CS起源切换程序" << std::endl;
cout <<"当前模式:"<<name<<endl;
std::cout << "1.CSSO 2.CS起源 3.exit" << std::endl;
int in;
std::cin >> in;
//CSSO为1CS起源为2
if (in == 1) {
} else if (in == 2) {
ini.load("config.ini");
std::string name = ini.get("User", "name", "unknown");
std::string age = ini.get("User", "age", "0");
std::string fullscreen = ini.get("Settings", "fullscreen", "false");
std::cout << "Name: " << name << std::endl;
std::cout << "Age: " << age << std::endl;
std::cout << "Fullscreen: " << fullscreen << std::endl;
} else if (in == 3) {
std::cout << "退出中" << std::endl;
Sleep(1000); // 暂停 1 秒
exit(0);
if (in==1)
{
const char* name = ini.GetValue("User","name","0");
if (name==0)
{
//运行命令
int result = system("ren bin bin2");
int result2 = system("ren bin2 bin");
if (result==0 and result2==0)
{
ini.SetValue("User","name","0");
cout <<"成功!"<<endl;
}else{
cout <<"失败!"<<endl;
}
}else{
cout <<"你已是CSSO模式!"<<endl;
}
}else if (in==2)
{
const char* name= ini.GetValue("User","name","0");
if (name!=1)
{
int result = system("");
}
}
}
int main() {
handleUserInput();
return 0;
}

BIN
change.exe Normal file

Binary file not shown.