private: System::Void blogin_Click(System::Object^ sender, System::EventArgs^ e) {
String^ user = gcnew String(username->Text);
String^ pass = gcnew String(password->Text);
CookieContainer^ ckie = gcnew CookieContainer();
try
{
Uri^ url = gcnew Uri("http://beta.rapidpremium.net/login.php");
String^ data = "username=" + user + "&password=" + pass + "&login=";
HttpWebRequest^ request = dynamic_cast<HttpWebRequest^>(WebRequest::Create(url));
request->Method = "POST";
request->CookieContainer = ckie;
request->Referer = "http://beta.rapidpremium.net/usercp.php";
request->ContentLength = data->Length;
request->ContentType = "application/x-www-form-urlencoded";
request->AllowAutoRedirect = true;
StreamWriter^ writer = gcnew StreamWriter(request->GetRequestStream());
writer->Write(data);
writer->Close();
HttpWebResponse^ response = dynamic_cast<HttpWebResponse^>(request->GetResponse());
StreamReader^ reader = gcnew StreamReader(response->GetResponseStream());
String^ tmp = reader->ReadToEnd();
response->Close();
}
catch (Exception^ ex)
{
MessageBox::Show(ex->ToString(),"Connection Error");
}
Uri^ url = gcnew Uri("http://beta.rapidpremium.net/usercp.php?action=showmylimits");
HttpWebRequest^ request = dynamic_cast<HttpWebRequest^>(WebRequest::Create(url));
request->Method = "POST";
request->CookieContainer = ckie;
request->Referer = "http://beta.rapidpremium.net/usercp.php?action=showmylimits";
HttpWebResponse^ response = dynamic_cast<HttpWebResponse^>(request->GetResponse());
StreamReader^ reader = gcnew StreamReader(response->GetResponseStream());
String^ tmp = reader->ReadToEnd();
response->Close();
UNLimits->Text = user + " Limits";
String^ info = String::Empty;
int Get_I = 0;
//RapidShare Limits
Get_I = tmp->IndexOf("You can");
Get_I = tmp->IndexOf("You can",Get_I);
tmp = tmp->Substring(Get_I + 0);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
RSLimits->Text = info;
//Megaupload Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
MULimits->Text = info;
//MegaPorn Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
MPLimits->Text = info;
//Megavideo Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
MVLimits->Text = info;
//MegaShares Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
MSLimits->Text = info;
//Netload Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
NLLimits->Text = info;
//HotFile Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
HFLimits->Text = info;
//Easy-Share Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
ESLimits->Text = info;
//Uploading Limits
Get_I = tmp->IndexOf("<br />You");
Get_I = tmp->IndexOf("<br />",Get_I);
tmp = tmp->Substring(Get_I + 6);
info = tmp->Substring(0,tmp->IndexOf("<br />"));
UPLimits->Text = info;
}
and i need to get the value of the request->CookieContainer = ckie;
to this code
private: System::Void bgen_Click(System::Object^ sender, System::EventArgs^ e) {
String^ links = gcnew String(linksbox->Text);
try
{
Uri^ url = gcnew Uri("http://beta.rapidpremium.net/usercp.php?action=downloader");
String^ data = links + "&download=Download";
HttpWebRequest^ request = dynamic_cast<HttpWebRequest^>(WebRequest::Create(url));
request->Method = "POST";
request->CookieContainer = ckie;
request->Referer = "http://beta.rapidpremium.net/usercp.php?action=downloader";
request->ContentLength = data->Length;
request->ContentType = "application/x-www-form-urlencoded";
request->AllowAutoRedirect = true;
StreamWriter^ writer = gcnew StreamWriter(request->GetRequestStream());
writer->Write(data);
writer->Close();
HttpWebResponse^ response = dynamic_cast<HttpWebResponse^>(request->GetResponse());
StreamReader^ reader = gcnew StreamReader(response->GetResponseStream());
String^ tmp = reader->ReadToEnd();
response->Close();
linksbox->AppendText(tmp);
}
catch (Exception^ ex)
{
MessageBox::Show(ex->ToString(),"Connection Error");
}
}

New Topic/Question
Reply



MultiQuote





|