QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); manager->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
#include <QNetworkAccessManager>
#include <QNetworkRequest>
void First::Send(){ QNetworkAccessManager *man = new QNetworkAccessManager(this); connect(man, SIGNAL(finished(QNetworkReply*)),this, SLOT(repFinish(QNetworkReply*))); QNetworkRequest PostRequest; PostRequest.setUrl((QUrl)"http://l2top.ru/vote/54/"); QString param = "referer=http%3A%2F%2Fl2top.ru%2Fvote%2F3118%2F&sec_referer=40059b144bfc1cdac2e7f35669724998d23598d5&voteOk=ok&f5c5f905="+ui.captchaLine->text()+"&name=Cowcancry"; QByteArray postz = param.toUtf8(); man->post(PostRequest,postz);}void First::repFinish(QNetworkReply* reply){ QString otvet; switch (reply->error()) { case 0: otvet = QString::fromUtf8(reply->readAll()); ui.myLabel -> setText(otvet);break; default: ui.statusLabel->setText("Else Error");break; } reply->deleteLater(); }
<!--// <input name='2fed8414' type='text' value='' class='num2' maxlength='14'> //--><!--// <input name='ed5d65d5' type='text' value='' class='num2' maxlength='14'> //--><!--// <input name='a3c4b058' type='text' value='' class='num2' maxlength='14'> //--><input name='e73ea100' type='text' value='' class='num2' maxlength='14'>