QUrl url(QString("http://localhost/barvalue.php/minisite2/get_gameInfo"));
QNetworkAccessManager manager;
QEventLoop loop;
qDebug() << "Reading code form"<<"http://www.hogoho.com/barvalue.php/minisite2/get_sigindata/index.html";
// 发出请求
QNetworkReply *reply = manager.get(QNetworkRequest(url));
QObject::connect(reply,SIGNAL(finished()),&loop,SLOT(quit()));
loop.exec();
QString code = reply->readAll();
QFile file("code.txt");
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
out<<code<<endl;
file.close();
时间: 2024-10-05 22:07:29