|
通过 process.execute 成功运行CMD 添加参数,实现执行PHP CGI,却找不到有相关的函数获取该DOS窗口返回的内容。希望借返回内容判断是否运动成功。请教各位有什么方法获取CMD返回内容?
还有个问题,想在按钮文本上显示 & 字符,请问如何实现?
- import win.ui;
- import process;
- import fsys;
- import fsys.dlg;
- /*DSG{{*/
- mainForm = ..win.form(text="aardio Form";right=524;bottom=397)
- mainForm.add(
- button={cls="button";text='Start PHP FastCGI Nginx';left=384;top=10;right=514;bottom=68;z=2};
- button2={cls="button";text="Stop PHP FastCGI";left=384;top=91;right=514;bottom=125;z=3};
- cgista={cls="static";text="PHP CGI 路径";left=8;top=344;right=82;bottom=362;transparent=1;z=6};
- log={cls="edit";left=7;top=9;right=377;bottom=329;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;vscroll=1;z=1};
- nbinxsta={cls="static";text="Nginx 路径";left=8;top=372;right=82;bottom=390;transparent=1;z=9};
- nginxpath={cls="edit";text="F:\Service\Nginx-1.9.1";left=85;top=368;right=311;bottom=390;edge=1;multiline=1;z=7};
- phpfcgipath={cls="edit";text="F:\Service\PHP-5.6.9-nts-VC11-x86";left=85;top=340;right=311;bottom=362;edge=1;multiline=1;z=4};
- selectcgi={cls="button";text="浏览..";left=316;top=339;right=377;bottom=362;z=5};
- selectnginx={cls="button";text="浏览..";left=316;top=367;right=377;bottom=390;z=8}
- )
- /*}}*/
- mainForm.selectnginx.oncommand = function(id,event){
- //var dir = fsys.dlg.open("Nginx|nginx.exe|");
- var dir = fsys.dlg.opendir();
- mainForm.nginxpath.text = dir + "";
-
- }
- mainForm.selectcgi.oncommand = function(id,event){
- //mainForm.msgbox( mainForm.selectcgi.text );
- var dir = fsys.dlg.opendir();
- mainForm.phpfcgipath.text = dir + "";
- }
- var fcgi,nginx = process();
- mainForm.button.oncommand = function(id,event)
- {
- ;
- // 启动PHP CGI
- fcgi = process.execute("cmd.exe",'/c ' + mainForm.phpfcgipath.text + 'php-cgi.exe -b 127.0.0.1:9000 -c ' + mainForm.phpfcgipath.text + 'php.ini',,0x0/*_SW_HIDE*/);
- //mainForm.msgbox( tostring(fcgi) );
- mainForm.msgbox( fsys.ge );
- }
- mainForm.button2.oncommand = function(id,event){
- process.kill("php-cgi.exe");
- mainForm.msgbox( '&'# )
- }
- mainForm.show()
- return win.loopMessage();
复制代码 |
|