- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- //http://www.url.com/member.php?action=login
- if ((textBox1->Text->IsNullOrWhiteSpace(textBox1->Text)) && (textBox1->Text->IsNullOrWhiteSpace(textBox2->Text)))
- {
- MessageBox::Show("Please fill in your credentials!", "url - Loader", MessageBoxButtons::OK,
- MessageBoxIcon::Error);
- }
- else
- {
- HttpWebRequest^ httpWebRequest = nullptr;
- HttpWebResponse^ httpWebResponse = nullptr;
- Stream^ stream = nullptr;
- StreamReader^ streamReader = nullptr;
- array<Byte>^ postBytes = nullptr;
-
- CookieContainer^ cookieContainer = gcnew CookieContainer();
- String^ sPostData = "username=" + textBox1->Text + "&password=" + textBox2->Text + "&remember=yes&submit=Login&action=do_login&url=http://url.com/member.php?action=login";
- String^ sFinalData = nullptr;
-
- try
- {
- httpWebRequest = (HttpWebRequest^)WebRequest::Create("http://www.url.com/");
- httpWebRequest->Method = "POST";
- httpWebRequest->ContentType = "application/x-www-form-urlencoded";
- postBytes = Encoding::UTF8->GetBytes(sPostData);
- httpWebRequest->ContentLength = postBytes->Length;
- httpWebRequest->CookieContainer = cookieContainer;
-
- stream = httpWebRequest->GetRequestStream();
- stream->Write(postBytes, 0, postBytes->Length);
- stream->Close();
- stream = nullptr;
-
- httpWebResponse = (HttpWebResponse^)httpWebRequest->GetResponse();
- streamReader = gcnew StreamReader(httpWebResponse->GetResponseStream(), Encoding::ASCII);
-
- sFinalData = streamReader->ReadToEnd();
-
- if (sFinalData->Contains("member.php?action=logout"))
- {
- MessageBox::Show("Login successful!", "", MessageBoxButtons::OK,
- MessageBoxIcon::Information);
- }
- else
- {
- MessageBox::Show("Login unsuccessful! Please check your credentials!", "", MessageBoxButtons::OK,
- MessageBoxIcon::Error);
- }
- }
- catch (Exception^ exception)
- {
-
- }
- }
💬 SpyHackerz Telegram — Anlık tartışmalar ve duyurular için katıl