daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest May 31st, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5.     QMainWindow(parent),
  6.     ui(new Ui::MainWindow)
  7. {
  8.     jar=new QNetworkCookieJar();
  9.     manager.setCookieJar(jar);
  10.     ui->setupUi(this);
  11. }
  12.  
  13. MainWindow::~MainWindow()
  14. {
  15.     delete ui;
  16.     delete jar;
  17. }
  18.  
  19. void MainWindow::End()
  20. {
  21.     ui->textBrowser->setText(reply->readAll());
  22. }
  23.  
  24. void MainWindow::on_pushButton_clicked()
  25. {
  26.     request.setUrl(QUrl("http://www.wiocha.pl/"));
  27.     request.setRawHeader(QByteArray("Host"), QByteArray("www.wiocha.pl"));
  28.     request.setRawHeader(QByteArray("User-Agent"), QByteArray("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53."));
  29.     request.setRawHeader(QByteArray("Accept"), QByteArray("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"));
  30.     request.setRawHeader(QByteArray("Accept-Language"), QByteArray("pl,en-US;q=0.7,en;q=0.3"));
  31.     request.setRawHeader(QByteArray("Accept-Encoding"), QByteArray("gzip, deflate"));
  32.     request.setRawHeader(QByteArray("Connection"), QByteArray("keep-alive"));
  33.     request.setRawHeader(QByteArray("Upgrade-Insecure-Requests"), QByteArray("1"));
  34.     QByteArray PostData="action=zaloguj&lista=zaloguj_sie&username=[login]&password=[hasło]&remember=yes&zaloguj=Zaloguj+si%EA";
  35.     reply=manager.get(request);
  36.     connect(reply, SIGNAL(finished()), this, SLOT(End()));
  37.     request.setUrl(QUrl("https://www.wiocha.pl/zaloguj_sie"));
  38.     request.setRawHeader(QByteArray("Content-Type"), QByteArray("application/x-www-form-urlencoded"));
  39.     request.setRawHeader(QByteArray("Content-Length"), QByteArray("103"));
  40.     request.setRawHeader(QByteArray("Refer"), QByteArray("https://www.wiocha.pl/zaloguj_sie"));
  41.     request.setRawHeader(QByteArray("Accept-Encoding"), QByteArray("gzip, deflate, br"));
  42.     reply=manager.post(request, PostData);
  43.     connect(reply, SIGNAL(finished()), this, SLOT(End()));
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top