diff --git a/change.cpp b/change.cpp index 07809d2..7060b73 100644 --- a/change.cpp +++ b/change.cpp @@ -2,37 +2,55 @@ #include #include #include +#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 <<"当前模式:"<> in; //CSSO为1,CS起源为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 <<"成功!"<