Update and delete
This commit is contained in:
parent
42a4b25c15
commit
2cec26b35d
18
.vscode/c_cpp_properties.json
vendored
18
.vscode/c_cpp_properties.json
vendored
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "windows-gcc-x64",
|
|
||||||
"includePath": [
|
|
||||||
"${workspaceFolder}/**"
|
|
||||||
],
|
|
||||||
"compilerPath": "D:/TDM-GCC/bin/gcc.exe",
|
|
||||||
"cStandard": "${default}",
|
|
||||||
"cppStandard": "${default}",
|
|
||||||
"intelliSenseMode": "windows-gcc-x64",
|
|
||||||
"compilerArgs": [
|
|
||||||
""
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"version": 4
|
|
||||||
}
|
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "C/C++ Runner: Debug Session",
|
|
||||||
"type": "cppdbg",
|
|
||||||
"request": "launch",
|
|
||||||
"args": [],
|
|
||||||
"stopAtEntry": false,
|
|
||||||
"externalConsole": true,
|
|
||||||
"cwd": "c:/Users/Admin/gitee/code",
|
|
||||||
"program": "c:/Users/Admin/gitee/code/build/Debug/outDebug",
|
|
||||||
"MIMode": "gdb",
|
|
||||||
"miDebuggerPath": "gdb",
|
|
||||||
"setupCommands": [
|
|
||||||
{
|
|
||||||
"description": "Enable pretty-printing for gdb",
|
|
||||||
"text": "-enable-pretty-printing",
|
|
||||||
"ignoreFailures": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
62
.vscode/settings.json
vendored
62
.vscode/settings.json
vendored
@ -1,63 +1,3 @@
|
|||||||
{
|
{
|
||||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
"C_Cpp.errorSquiggles": "disabled"
|
||||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
|
||||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
|
||||||
"C_Cpp_Runner.cStandard": "",
|
|
||||||
"C_Cpp_Runner.cppStandard": "",
|
|
||||||
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
|
|
||||||
"C_Cpp_Runner.useMsvc": false,
|
|
||||||
"C_Cpp_Runner.warnings": [
|
|
||||||
"-Wall",
|
|
||||||
"-Wextra",
|
|
||||||
"-Wpedantic",
|
|
||||||
"-Wshadow",
|
|
||||||
"-Wformat=2",
|
|
||||||
"-Wcast-align",
|
|
||||||
"-Wconversion",
|
|
||||||
"-Wsign-conversion",
|
|
||||||
"-Wnull-dereference"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.msvcWarnings": [
|
|
||||||
"/W4",
|
|
||||||
"/permissive-",
|
|
||||||
"/w14242",
|
|
||||||
"/w14287",
|
|
||||||
"/w14296",
|
|
||||||
"/w14311",
|
|
||||||
"/w14826",
|
|
||||||
"/w44062",
|
|
||||||
"/w44242",
|
|
||||||
"/w14905",
|
|
||||||
"/w14906",
|
|
||||||
"/w14263",
|
|
||||||
"/w44265",
|
|
||||||
"/w14928"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.enableWarnings": true,
|
|
||||||
"C_Cpp_Runner.warningsAsError": false,
|
|
||||||
"C_Cpp_Runner.compilerArgs": [],
|
|
||||||
"C_Cpp_Runner.linkerArgs": [],
|
|
||||||
"C_Cpp_Runner.includePaths": [],
|
|
||||||
"C_Cpp_Runner.includeSearch": [
|
|
||||||
"*",
|
|
||||||
"**/*"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.excludeSearch": [
|
|
||||||
"**/build",
|
|
||||||
"**/build/**",
|
|
||||||
"**/.*",
|
|
||||||
"**/.*/**",
|
|
||||||
"**/.vscode",
|
|
||||||
"**/.vscode/**"
|
|
||||||
],
|
|
||||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
|
||||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
|
||||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
|
||||||
"C_Cpp_Runner.showCompilationTime": false,
|
|
||||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
|
||||||
"C_Cpp_Runner.msvcSecureNoWarnings": false,
|
|
||||||
"files.associations": {
|
|
||||||
"iosfwd": "cpp",
|
|
||||||
"ostream": "cpp"
|
|
||||||
}
|
|
||||||
}
|
}
|
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@ -3,7 +3,7 @@
|
|||||||
{
|
{
|
||||||
"type": "cppbuild",
|
"type": "cppbuild",
|
||||||
"label": "C/C++: g++.exe 生成活动文件",
|
"label": "C/C++: g++.exe 生成活动文件",
|
||||||
"command": "D:\\TDM-GCC\\bin\\g++.exe",
|
"command": "F:\\TDM-gcc\\bin\\g++.exe",
|
||||||
"args": [
|
"args": [
|
||||||
"-fdiagnostics-color=always",
|
"-fdiagnostics-color=always",
|
||||||
"-g",
|
"-g",
|
||||||
|
37
change.cpp
37
change.cpp
@ -2,7 +2,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <fstream> // 用于文件存在性检查
|
#include <fstream>
|
||||||
#include "SimpleIni.h"
|
#include "SimpleIni.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -10,6 +10,7 @@ using namespace std;
|
|||||||
// 函数声明
|
// 函数声明
|
||||||
bool fileExists(const std::string& filename);
|
bool fileExists(const std::string& filename);
|
||||||
bool createDefaultConfig(const std::string& filename);
|
bool createDefaultConfig(const std::string& filename);
|
||||||
|
bool renameFolder(const std::string& oldName, const std::string& newName); // 使用 MoveFile
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
const std::string configFile = "config.ini";
|
const std::string configFile = "config.ini";
|
||||||
@ -39,7 +40,7 @@ int main() {
|
|||||||
const char* name = ini.GetValue("User", "name", "0");
|
const char* name = ini.GetValue("User", "name", "0");
|
||||||
|
|
||||||
cout << "欢迎使用CSSO与CS起源切换程序" << endl;
|
cout << "欢迎使用CSSO与CS起源切换程序" << endl;
|
||||||
cout << "当前模式: " <<name<<endl;
|
cout << "当前模式: " << name <<"(0为CSSO,1为CS起源)"<< endl;
|
||||||
cout << "请选择操作:" << endl;
|
cout << "请选择操作:" << endl;
|
||||||
cout << "1. CSSO" << endl;
|
cout << "1. CSSO" << endl;
|
||||||
cout << "2. CS起源" << endl;
|
cout << "2. CS起源" << endl;
|
||||||
@ -53,10 +54,10 @@ int main() {
|
|||||||
cout << "你已是CSSO模式!" << endl;
|
cout << "你已是CSSO模式!" << endl;
|
||||||
} else {
|
} else {
|
||||||
// 切换到CSSO模式
|
// 切换到CSSO模式
|
||||||
int result1 = system("ren bin bin_backup");
|
bool result1 = renameFolder("bin", "bin_backup");
|
||||||
int result2 = system("ren bin2 bin");
|
bool result2 = renameFolder("bin2", "bin");
|
||||||
|
|
||||||
if (result1 == 0 && result2 == 0) {
|
if (result1 && result2) {
|
||||||
ini.SetValue("User", "name", "0");
|
ini.SetValue("User", "name", "0");
|
||||||
SI_Error saveRc = ini.SaveFile(configFile.c_str());
|
SI_Error saveRc = ini.SaveFile(configFile.c_str());
|
||||||
if (saveRc >= 0) {
|
if (saveRc >= 0) {
|
||||||
@ -65,9 +66,9 @@ int main() {
|
|||||||
cout << "保存配置文件失败!" << endl;
|
cout << "保存配置文件失败!" << endl;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cout << "切换失败!" << endl;
|
cout << "切换失败!检查文件路径或权限。" << endl;
|
||||||
}
|
}
|
||||||
Sleep(100);
|
Sleep(1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (choice == 2) {
|
else if (choice == 2) {
|
||||||
@ -75,10 +76,10 @@ int main() {
|
|||||||
cout << "你已是CS起源模式!" << endl;
|
cout << "你已是CS起源模式!" << endl;
|
||||||
} else {
|
} else {
|
||||||
// 切换到CS起源模式
|
// 切换到CS起源模式
|
||||||
int result1 = system("ren bin bin2");
|
bool result1 = renameFolder("bin", "bin2");
|
||||||
int result2 = system("ren bin_backup bin");
|
bool result2 = renameFolder("bin_backup", "bin");
|
||||||
|
|
||||||
if (result1 == 0 && result2 == 0) {
|
if (result1 && result2) {
|
||||||
ini.SetValue("User", "name", "1");
|
ini.SetValue("User", "name", "1");
|
||||||
SI_Error saveRc = ini.SaveFile(configFile.c_str());
|
SI_Error saveRc = ini.SaveFile(configFile.c_str());
|
||||||
if (saveRc >= 0) {
|
if (saveRc >= 0) {
|
||||||
@ -87,9 +88,9 @@ int main() {
|
|||||||
cout << "保存配置文件失败!" << endl;
|
cout << "保存配置文件失败!" << endl;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cout << "切换失败!" << endl;
|
cout << "切换失败!检查文件路径或权限。" << endl;
|
||||||
}
|
}
|
||||||
Sleep(100);
|
Sleep(1500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (choice == 3) {
|
else if (choice == 3) {
|
||||||
@ -123,3 +124,15 @@ bool createDefaultConfig(const std::string& filename) {
|
|||||||
SI_Error rc = ini.SaveFile(filename.c_str());
|
SI_Error rc = ini.SaveFile(filename.c_str());
|
||||||
return (rc >= 0);
|
return (rc >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 使用 MoveFile 重命名文件夹
|
||||||
|
bool renameFolder(const std::string& oldName, const std::string& newName) {
|
||||||
|
if (MoveFile(oldName.c_str(), newName.c_str())) {
|
||||||
|
cout << "重命名成功: " << oldName << " -> " << newName << endl;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
DWORD error = GetLastError();
|
||||||
|
cout << "重命名失败: " << oldName << " -> " << newName << " (错误代码: " << error << ")" << endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BIN
change.exe
BIN
change.exe
Binary file not shown.
43
l.cpp
43
l.cpp
@ -1,43 +0,0 @@
|
|||||||
#include<iostream>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int qian();
|
|
||||||
int shi11();
|
|
||||||
|
|
||||||
int main(){
|
|
||||||
cout <<"现在是百数计算"<<endl;
|
|
||||||
int number,ge,shi,bai;
|
|
||||||
cin >>number;
|
|
||||||
ge = number%10;
|
|
||||||
shi = number/10%10;
|
|
||||||
bai = number / 100;
|
|
||||||
number = ge*100 + shi*10 + bai;
|
|
||||||
cout << number<<endl;
|
|
||||||
shi11();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int shi11(){
|
|
||||||
cout <<"现在是十数计算"<<endl;
|
|
||||||
int number,ge,shi;
|
|
||||||
cin >>number;
|
|
||||||
ge = number%10;
|
|
||||||
shi = number /10 ;
|
|
||||||
number = ge*10 + shi;
|
|
||||||
cout <<number<<endl;
|
|
||||||
qian();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int qian(){
|
|
||||||
cout <<"现在是千数计算"<<endl;
|
|
||||||
int number1,ge1,shi1,bai1,qian1;
|
|
||||||
cin >>number1;
|
|
||||||
ge1 = number1 % 10;
|
|
||||||
shi1 = number1 / 10 % 10;
|
|
||||||
bai1 = number1 / 100 % 10;
|
|
||||||
qian1 = number1 /1000;
|
|
||||||
number1 = ge1*1000 + shi1*100 + bai1 *10 + qian1;
|
|
||||||
cout <<number1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user