2024-10-04 16:03:58 +08:00
|
|
|
|
#include <iostream>
|
2024-10-04 16:26:37 +08:00
|
|
|
|
#include<string>
|
|
|
|
|
#include<windows.h>
|
|
|
|
|
#include<cstdlib>
|
2024-10-04 16:42:46 +08:00
|
|
|
|
#include"SimpleIni.h"
|
2024-10-04 16:03:58 +08:00
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
2024-10-04 16:42:46 +08:00
|
|
|
|
int main() {
|
|
|
|
|
//初始化ini文件
|
|
|
|
|
CSimpleIniA ini;
|
|
|
|
|
ini.SetUnicode();
|
|
|
|
|
ini.SetMultiKey(true);
|
|
|
|
|
ini.LoadFile("config.ini");
|
|
|
|
|
const char* name = ini.GetValue("User","name","0");
|
|
|
|
|
|
2024-10-04 16:03:58 +08:00
|
|
|
|
std::cout << "欢迎使用CSSO与CS起源切换程序" << std::endl;
|
2024-10-04 16:42:46 +08:00
|
|
|
|
cout <<"当前模式:"<<name<<endl;
|
2024-10-04 16:03:58 +08:00
|
|
|
|
std::cout << "1.CSSO 2.CS起源 3.exit" << std::endl;
|
|
|
|
|
int in;
|
|
|
|
|
std::cin >> in;
|
|
|
|
|
|
2024-10-04 16:26:37 +08:00
|
|
|
|
|
2024-10-04 16:03:58 +08:00
|
|
|
|
//CSSO为1,CS起源为2
|
2024-10-04 16:42:46 +08:00
|
|
|
|
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("");
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-04 16:03:58 +08:00
|
|
|
|
}
|
2024-10-04 16:42:46 +08:00
|
|
|
|
|
|
|
|
|
|
2024-10-04 16:03:58 +08:00
|
|
|
|
}
|