update
This commit is contained in:
parent
bbf0b48ef0
commit
e62d624f68
62
change.cpp
62
change.cpp
@ -2,37 +2,55 @@
|
|||||||
#include<string>
|
#include<string>
|
||||||
#include<windows.h>
|
#include<windows.h>
|
||||||
#include<cstdlib>
|
#include<cstdlib>
|
||||||
|
#include"SimpleIni.h"
|
||||||
|
|
||||||
using namespace std;
|
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;
|
std::cout << "欢迎使用CSSO与CS起源切换程序" << std::endl;
|
||||||
|
cout <<"当前模式:"<<name<<endl;
|
||||||
std::cout << "1.CSSO 2.CS起源 3.exit" << std::endl;
|
std::cout << "1.CSSO 2.CS起源 3.exit" << std::endl;
|
||||||
int in;
|
int in;
|
||||||
std::cin >> in;
|
std::cin >> in;
|
||||||
|
|
||||||
|
|
||||||
//CSSO为1,CS起源为2
|
//CSSO为1,CS起源为2
|
||||||
if (in == 1) {
|
if (in==1)
|
||||||
|
{
|
||||||
} else if (in == 2) {
|
const char* name = ini.GetValue("User","name","0");
|
||||||
ini.load("config.ini");
|
if (name==0)
|
||||||
std::string name = ini.get("User", "name", "unknown");
|
{
|
||||||
std::string age = ini.get("User", "age", "0");
|
//运行命令
|
||||||
std::string fullscreen = ini.get("Settings", "fullscreen", "false");
|
int result = system("ren bin bin2");
|
||||||
|
int result2 = system("ren bin2 bin");
|
||||||
std::cout << "Name: " << name << std::endl;
|
if (result==0 and result2==0)
|
||||||
std::cout << "Age: " << age << std::endl;
|
{
|
||||||
std::cout << "Fullscreen: " << fullscreen << std::endl;
|
ini.SetValue("User","name","0");
|
||||||
|
cout <<"成功!"<<endl;
|
||||||
} else if (in == 3) {
|
}else{
|
||||||
std::cout << "退出中" << std::endl;
|
cout <<"失败!"<<endl;
|
||||||
Sleep(1000); // 暂停 1 秒
|
}
|
||||||
exit(0);
|
|
||||||
|
}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
BIN
change.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user