首页 > 其他 > 详细

Run 1.0

时间:2019-05-15 14:27:45      阅读:138      评论:0      收藏:0      [点我收藏+]

main.cpp

 1 #include <iostream>
 2 #include <fstream>
 3 #include <unistd.h>
 4 #include <windows.h>
 5 #include <string.h>
 6 
 7 #define MAX_BUF 1024*1024
 8 #define CFG_NAME "command.ini"
 9 
10 using namespace std;
11 
12 int main() {
13     string path = _pgmptr;
14     path += "/..";
15     chdir ( path.c_str() );
16     char buf[MAX_BUF];
17     ifstream in ( CFG_NAME );
18     if ( !in.is_open() ) {
19         cout << "Can not open " << CFG_NAME << "." << endl;
20         Sleep ( 3000 );
21         return 1;
22     }
23     if ( !in.eof() ) {
24         in.getline ( buf, MAX_BUF );
25     }
26     in.close();
27     system ( buf );
28     return 0;
29 }

command.ini

1 where cmd > C:\testfile.txt

 技术分享图片

技术分享图片

技术分享图片

附件1

Run 1.0

原文:https://www.cnblogs.com/rms365/p/10867849.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!