diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dcc55b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.vs/ +debug/ +release/ \ No newline at end of file diff --git a/DisableLGhubAutoUpdate.vcxproj b/DisableLGhubAutoUpdate.vcxproj index 50f0fbb..2b22dbc 100644 --- a/DisableLGhubAutoUpdate.vcxproj +++ b/DisableLGhubAutoUpdate.vcxproj @@ -24,6 +24,7 @@ + @@ -96,9 +97,10 @@ $(ProjectName).$(PlatformTarget)-0.1.0 + $(SolutionDir)$(Configuration)\$(PlatformTarget)\ - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Configuration)\$(PlatformTarget)\ $(Configuration)\ $(ProjectName).$(PlatformTarget)-0.1.0 diff --git a/DisableLGhubAutoUpdate.vcxproj.filters b/DisableLGhubAutoUpdate.vcxproj.filters index b0ef186..94627f0 100644 --- a/DisableLGhubAutoUpdate.vcxproj.filters +++ b/DisableLGhubAutoUpdate.vcxproj.filters @@ -30,6 +30,9 @@ 头文件 + + 头文件 + diff --git a/Main.cpp b/Main.cpp index 338bde3..b743961 100644 --- a/Main.cpp +++ b/Main.cpp @@ -1,40 +1,9 @@ -#include "include/ChangeLGServices.hpp" - -void ProgramStart() -{ - LGServices* LGS = new LGServices; - - Change_LG_service(LGS);//更改服务类型为手动 - - ReBoot_LG_Services(LGS);//重启动LG服务 - - Get_LGHub_Services_Directory(LGS);//获取服务所在目录 - - Format_LGhub_Directory(LGS);//通过服务所在路径格式化 - - AddLGFWRule(LGS);//添加防火墙规则 - - ChangeLGhubJson(LGS);//更改罗技配置文件 - - - delete(LGS); - system("pause"); - -} - -void AboutThis() -{ - std::cout << "->关于此项目<-" << std::endl; - std::cout << "项目地址:-> https://github.com/li9633/DisableLGhubAutoUpdate" << std::endl; - std::cout << "遇到问题请向本项目提交issue!" << std::endl; - system("pause"); - system("cls"); -} +#include "include/Main.hpp" int main(void) { int Index = NULL; - while (true) + while (!std::cin.fail()) { std::cout << "-----------------------------------------" << std::endl; std::cout << "请输入特定选项后按Enter" << std::endl; @@ -53,13 +22,54 @@ int main(void) case 2: { AboutThis(); + break; } default: + { + std::cout << "输入不正确,请重新输入!" << std::endl; + std::cin.clear(); + std::cin.ignore(INT_MAX, '\n'); + system("pause"); + system("cls"); break; } + } } return 0; +} + + + +void ProgramStart() +{ + LGServices* LGS = new LGServices; + + Change_LG_service(LGS);//更改服务类型为手动 + + ReBoot_LG_Services(LGS);//重启动LG服务 + + Get_LGHub_Services_Directory(LGS);//获取服务所在目录 + + Format_LGhub_Directory(LGS);//通过服务所在路径格式化 + + AddLGFWRule(LGS);//添加防火墙规则 + + ChangeLGhubJson(LGS);//更改罗技配置文件 + + + delete(LGS); + system("pause"); + +} + +void AboutThis() +{ + std::cout << "->关于此项目<-" << std::endl; + std::cout << "项目地址:-> https://github.com/li9633/DisableLGhubAutoUpdate" << std::endl; + std::cout << "遇到问题请向本项目提交issue!" << std::endl; + system("pause"); + system("cls"); } \ No newline at end of file diff --git a/README.md b/README.md index d5e0694..b2845e0 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,3 @@ - fifo_map | -> [Github](https://github.com/nlohmann/fifo_map) - - - diff --git a/include/Main.hpp b/include/Main.hpp new file mode 100644 index 0000000..5cb3fbf --- /dev/null +++ b/include/Main.hpp @@ -0,0 +1,5 @@ +#include "ChangeLGServices.hpp" + + +void AboutThis(); +void ProgramStart(); \ No newline at end of file