paip.c++ cli 命令行 调用总结

paip.c++ cli 调用总结


作者Attilax ,  EMAIL:1466519819@qq.com 
来源:attilax的专栏
地址:http://blog.csdn.net/attilax




void MainWindow::on_btn_exeNetDll_clicked()
{
myprocess= new QProcess(this);
        connect(myprocess, SIGNAL(readyReadStandardOutput()),
                this, SLOT(outlog()));
        QString cmd="C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe  \"&'C:\\Documents and Settings\\Administrator\\桌面\\atips.ps1'\" ";
        myprocess->start(cmd);
        // For debugging: Wait until the process has finished.
        myprocess->waitForFinished(30000);
        qDebug() << "myprocess error code:" << myprocess->error();
   //     QProcess:: Crashed
 
 
}




//注意,这里可以调用多次了...一般碰见\R\N就可以return的兰...
void MainWindow::outlog()
{
    QString abc = myprocess->readAllStandardOutput();
 // emit outlogtext(abc);
         qDebug() << "----cmd return:----"+abc;
}



posted @ 2013-09-24 18:57  attilaxAti  阅读(24)  评论(0编辑  收藏  举报