QProcess p(0); p.start("route");//写入要运行的指令即可 p.waitForStarted(); p.waitForFinished(); qDebug()<<QString::fromLocal8Bit(p.readAllStandardError()); QProcess p(0); p.start("cmd", QStringList()<<"/c"<<"dir");//找网络ip的指令(netstat -aon|findstr 218.5.241.13:211) p.waitForStarted(); p.waitForFinished(); qDebug()<<QString::fromLocal8Bit(p.readAllStandardOutput());
https://blog.csdn.net/qq_34389528/article/details/76283932