本文整理汇总了C#中GlobusHttpHelper.postFormDataProxy方法的典型用法代码示例。如果您正苦于以下问题:C# GlobusHttpHelper.postFormDataProxy方法的具体用法?C# GlobusHttpHelper.postFormDataProxy怎么用?C# GlobusHttpHelper.postFormDataProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobusHttpHelper
的用法示例。
在下文中一共展示了GlobusHttpHelper.postFormDataProxy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoginPinterestAccount1forlee
//.........这里部分代码省略.........
if (PinPage.Contains("app_version"))
{
try
{
string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(PinPage, "app_version");
if (ArrAppVersion.Count() > 0)
{
string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];
int startindex = DataString.IndexOf("\"");
string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("}", string.Empty).Replace("\"", string.Empty);
int endindex = start.IndexOf(",");
App_version = start.Substring(0, endindex);
if (!string.IsNullOrEmpty(App_version))
{
objPinUser.App_version = App_version;
}
}
}
catch { };
}
else
{
///App version is not available in page source
}
string referer = "https://www.pinterest.com/";
string login = string.Empty;
try
{
string PostData1 = "source_url=%2F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3EModalManager%3EModal%3EPlainSignupModal%3ESignupForm%3EUserRegister(next%3D%2F%2C+wall_class%3DgrayWall%2C+container%3Dplain_signup_modal%2C+unified_auth%3Dundefined%2C+is_login_form%3Dtrue%2C+show_personalize_field%3Dundefined%2C+auto_follow%3Dundefined%2C+register%3Dtrue)";
login = globusHttpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
}
catch (Exception ex)
{ }
try
{
AfterLoginPageSource = globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
}
catch (Exception ex)
{ }
if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder") || AfterLoginPageSource.Contains("header1\": \"What are you interested in?") || AfterLoginPageSource.Contains("\"error\": null") || login.Contains("\"error\": null"))
{
// GlobusLogHelper.log.Info(" => [ Successfully Login for " + Username + " ]");
objPinUser.globusHttpHelper = globusHttpHelper;
this.LoggedIn = true;
objPinUser.isloggedin = true;
objPinUser.LoginStatus = "Success";
}
else
{
//GlobusLogHelper.log.Info(" => [ Login Failed for " + Username + " ]");
this.LoggedIn = false;
objPinUser.LoginStatus = "Fail";
try
{
try
{
QueryExecuter.updatetb_emails("", "", "", "", objPinUser.ScreenName, Username, objPinUser.LoginStatus);
}
catch
{
示例2: LoginPinterestAccount1
public bool LoginPinterestAccount1(ref GlobusHttpHelper httpHelper, string Username, string Password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword,string ss)
{
lock (this)
{
string Name = string.Empty;
string ProxyAddress = proxyAddress;
string ProxyPort = proxyPort;
string ProxyUsername = proxyUsername;
string ProxyPassword = proxyPassword;
string AfterLoginPageSource = string.Empty;
try
{
//string PinPage = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/"));
string PinPage = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/"), ProxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
//string _MainSourcePage = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3EHomePage()%3EUnauthHomePage(signup_email%3Dnull%2C+tab%3Dfollowing%2C+cmp%3Dnull%2C+resource%3DInspiredWallResource())&_=1424169081757"));
string _MainSourcePage = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3EHomePage()%3EUnauthHomePage(signup_email%3Dnull%2C+tab%3Dfollowing%2C+cmp%3Dnull%2C+resource%3DInspiredWallResource())&_=1424169081757"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
//string _MainSourcePage = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/resource/NoopResource/get/?source_url=%2Flogin%2F%3Faction%3Dlogin%26next%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26referrer%3Dhome_page&data=%7B%22options%22%3A%7B%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3EHomePage%3EUnauthLoggedOutHomePage%3ELoginButton(class_name%3DloggedOutHomePageLogin%2C+text%3DLog+in%2C+element_type%3Da)&_=1437811789975"));
///Get App Version
if (PinPage.Contains("app_version"))
{
try
{
string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(PinPage, "app_version");
if (ArrAppVersion.Count() > 0)
{
string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];
int startindex = DataString.IndexOf("\"");
string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("}", string.Empty).Replace("\"", string.Empty);
int endindex = start.IndexOf(",");
App_version = start.Substring(0, endindex);
}
}
catch { };
}
else
{
///App version is not available in page source
}
string referer = "https://www.pinterest.com/";
string PostData1 = "source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(text%3DLog+In%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";
//string PostData1 = "source_url=%2Flogin%2F%3Fnext%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + "%22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(text%3DLog+In%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";
//PostData = "source_url=%2Fsettings%2F&data=%7B%22options%22%3A%7B%22first_name%22%3A%22abhay%22%2C%22last_name%22%3A%22mahavar%22%2C%22username%22%3A%22"++"%22%2C%22about%22%3A%22hi+i+am+software+Developer%22%2C%22location%22%3A%22kanpur%22%2C%22website_url%22%3A%22http%3A%2F%2Fwww.scriptnut.com%2F%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22b1da8fc%22%2C%22https_exp%22%3Afalse%7D%7D&module_path=App()%3EUserSettingsPage(resource%3DUserSettingsResource())%3EShowModalButton(module%3DUserEdit)%23Modal(module%3DUserEdit(resource%3DUserSettingsResource()))";
//string PostData1 = "source_url=%2Flogin%2F%3Faction%3Dlogin%26next%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26prev%3Dhttps%253A%252F%252Fwww.pinterest.com%252F%26referrer%3Dhome_page&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Uri.EscapeDataString(Password) + " %22%7D%2C%22context%22%3A%7B%7D%7D&module_path=App%3ELoginPage%3ELogin%3EButton(text%3DLog+in%2C+size%3Dlarge%2C+class_name%3Dprimary%2C+type%3Dsubmit)";
//string login = httpHelper.postFormDataProxyPin(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer);
string login = httpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
// string CheckLogin = httpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData1, referer, ProxyAddress, int.Parse(ProxyUsername), ProxyPassword, ProxyPort);
//AfterLoginPageSource = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com"));
AfterLoginPageSource = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder") || AfterLoginPageSource.Contains("header1\": \"What are you interested in?") || AfterLoginPageSource.Contains("\"error\": null") || login.Contains("\"error\": null"))
{
Log("[ " + DateTime.Now + " ] => [ Successfully Login for " + Username + " ]");
this.LoggedIn = true;
//GlobusLogHelper.log.Debug("[ Social Sites => Pinterest => Account Creator => [ Successfully Login for " + Username + " ]");
//GlobusLogHelper.log.Info("[ Social Sites => Pinterest => Account Creator => [ Successfully Login for " + Username + " ]");
//this.LoggedIn = true;
//return true;
}
else
{
Log("[ " + DateTime.Now + " ] => [ Login Failed for " + Username + " ]");
this.LoggedIn = false;
//GlobusLogHelper.log.Debug("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
//GlobusLogHelper.log.Info("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
//this.LoggedIn = false;
return false;
}
}
catch (Exception ex)
{
Log("[ " + DateTime.Now + " ] => [ Login Failed for " + Username + " ]");
this.LoggedIn = false;
//GlobusLogHelper.log.Debug("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
//GlobusLogHelper.log.Info("[ Social Sites => Pinterest => Account Creator => [ Login Failed for " + Username + " ]");
//GlobusLogHelper.log.Error(ex.Message);
return false;
}
try
{
// string CheckWlcomeUrl = httpHelper.getHtmlfromUrl(new Uri("https://www.pinterest.com/"));
List<string> listFollowersFromDatabse = new List<string>();
//.........这里部分代码省略.........
示例3: EmailVerificationMultithreaded
/// <summary>
/// Makes Http Request to Confirmation URL from Mail, also requests other JS, CSS URLs
/// </summary>
/// <param name="ConfirmationUrl"></param>
/// <param name="gif"></param>
/// <param name="logpic"></param>
public void EmailVerificationMultithreaded(string ConfirmationUrl, string gif, string logpic, string email, string password, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref GlobusHttpHelper HttpHelper)
{
int intProxyPort = 80;
Regex IdCheck = new Regex("^[0-9]*$");
if (!string.IsNullOrEmpty(proxyPort) && IdCheck.IsMatch(proxyPort))
{
intProxyPort = int.Parse(proxyPort);
}
string pgSrc_ConfirmationUrl = HttpHelper.getHtmlfromUrlProxy(new Uri(ConfirmationUrl), proxyAddress, intProxyPort, proxyUsername, proxyPassword);
string valueLSD = "name=" + "\"lsd\"";
string pgSrc_Login = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/login.php"));
int startIndex = pgSrc_Login.IndexOf(valueLSD) + 18;
string value = pgSrc_Login.Substring(startIndex, 5);
//Log("Logging in with " + Username);
string ResponseLogin = HttpHelper.postFormDataProxy(new Uri("https://www.facebook.com/login.php?login_attempt=1"), "charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "&locale=en_US&email=" + email.Split('@')[0] + "%40" + email.Split('@')[1] + "&pass=" + password + "&persistent=1&default_persistent=1&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "", proxyAddress, intProxyPort, proxyUsername, proxyPassword);
pgSrc_ConfirmationUrl = HttpHelper.getHtmlfromUrl(new Uri(ConfirmationUrl));
try
{
string pgSrc_Gif = HttpHelper.getHtmlfromUrl(new Uri(gif));
}
catch { }
try
{
string pgSrc_Logpic = HttpHelper.getHtmlfromUrl(new Uri(logpic + "&s=a"));
}
catch { }
try
{
string pgSrc_Logpic = HttpHelper.getHtmlfromUrl(new Uri(logpic));
}
catch { }
//** User Id ***************//////////////////////////////////
string UsreId = string.Empty;
if (string.IsNullOrEmpty(UsreId))
{
UsreId = GlobusHttpHelper.ParseJson(ResponseLogin, "user");
}
//*** Post Data **************//////////////////////////////////
string fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
if (string.IsNullOrEmpty(fb_dtsg))
{
fb_dtsg = GlobusHttpHelper.ParseJson(ResponseLogin, "fb_dtsg");
}
string post_form_id = GlobusHttpHelper.GetParamValue(ResponseLogin, "post_form_id");//pageSourceHome.Substring(pageSourceHome.IndexOf("post_form_id"), 200);
if (string.IsNullOrEmpty(post_form_id))
{
post_form_id = GlobusHttpHelper.ParseJson(ResponseLogin, "post_form_id");
}
string pgSrc_email_confirmed = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/?email_confirmed=1"));
string pgSrc_contact_importer = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted.php?step=contact_importer"));
#region Skipping Code
///Code for skipping additional optional Page
try
{
string phstamp = "165816812085115" + RandomNumberGenerator.GenerateRandom(10848130, 10999999);
string postDataSkipFirstStep = "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&step_name=friend_requests&next_step_name=contact_importer&skip=Skip&lsd&post_form_id_source=AsyncRequest&__user=" + UsreId + "&phstamp=" + phstamp;
string postRes = HttpHelper.postFormData(new Uri("http://www.facebook.com/ajax/growth/nux/wizard/steps.php?__a=1"), postDataSkipFirstStep);
Thread.Sleep(1000);
}
catch { }
pgSrc_contact_importer = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/gettingstarted/?step=contact_importer"));
//** FB Account Check email varified or not ***********************************************************************************//
#region FB Account Check email varified or not
//string pageSrc1 = string.Empty;
string pageSrc2 = string.Empty;
string pageSrc3 = string.Empty;
string pageSrc4 = string.Empty;
string substr1 = string.Empty;
//if (pgSrc_contact_importer.Contains("Are your friends already on Facebook?") && pgSrc_contact_importer.Contains("Skip this step"))
if (true)
{
//.........这里部分代码省略.........
示例4: Login
public void Login(ref GlobusHttpHelper httpHelper)
{
try
{
this.httpHelper = httpHelper;
if (string.IsNullOrEmpty(proxyPort))
{
proxyPort = "0";
}
//string _MainSourcePage = httpHelper.getHtmlfromUrl(new Uri("https://pinterest.com/login/"), string.Empty, string.Empty, this.UserAgent);
string _MainSourcePage = httpHelper.getHtmlfromUrlProxy(new Uri("https://pinterest.com/login/"), "", proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword, "");
///Get App Version
if (_MainSourcePage.Contains("app_version"))
{
string[] ArrAppVersion = System.Text.RegularExpressions.Regex.Split(_MainSourcePage, "app_version");
if (ArrAppVersion.Count() > 0)
{
string DataString = ArrAppVersion[ArrAppVersion.Count() - 1];
int startindex = DataString.IndexOf("\"");
string start = DataString.Substring(startindex).Replace("\": \"", "").Replace("\"", string.Empty);
int endindex = start.IndexOf("}");
App_version = start.Substring(0, endindex);
}
}
else
{
///App version is not available in page source
}
string referer = "https://www.pinterest.com/login/";
//string PostData = "source_url=%2Flogin%2F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Password + "%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22" + App_version + "%22%7D%7D&module_path%3DApp()%3ELoginPage()%3ELogin()%3EButton(class_name%3Dprimary%2C%20text%3DLog%20in%2C%20type%3Dsubmit%2C%20size%3Dlarge)";
string PostData = "source_url=%2Flogin%2F&data=%7B%22options%22%3A%7B%22username_or_email%22%3A%22" + Uri.EscapeDataString(Username) + "%22%2C%22password%22%3A%22" + Password + "%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22" + App_version + "%22%2C%22https_exp%22%3Afalse%7D%7D&module_path=App()%3ELoginPage()%3ELogin()%3EButton(class_name%3Dprimary%2C+text%3DLog+in%2C+type%3Dsubmit%2C+size%3Dlarge)";
//PostData = "source_url=%2Fsettings%2F&data=%7B%22options%22%3A%7B%22first_name%22%3A%22abhay%22%2C%22last_name%22%3A%22mahavar%22%2C%22username%22%3A%22"++"%22%2C%22about%22%3A%22hi+i+am+software+Developer%22%2C%22location%22%3A%22kanpur%22%2C%22website_url%22%3A%22http%3A%2F%2Fwww.scriptnut.com%2F%22%7D%2C%22context%22%3A%7B%22app_version%22%3A%22b1da8fc%22%2C%22https_exp%22%3Afalse%7D%7D&module_path=App()%3EUserSettingsPage(resource%3DUserSettingsResource())%3EShowModalButton(module%3DUserEdit)%23Modal(module%3DUserEdit(resource%3DUserSettingsResource()))";
string login = httpHelper.postFormDataProxy(new Uri("https://www.pinterest.com/resource/UserSessionResource/create/"), PostData, referer, proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);
string AfterLoginPageSource = httpHelper.getHtmlfromUrlProxy(new Uri("https://www.pinterest.com"), "", proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword, "");
if (AfterLoginPageSource.Contains("Logout") || AfterLoginPageSource.Contains("pinHolder"))
{
Log("[ " + DateTime.Now + " ] => [ Successfully Login for " + Username + " ]");
this.LoggedIn = true;
}
else
{
Log("[ " + DateTime.Now + " ] => [ Login Failed for " + Username + " ]");
this.LoggedIn = false;
}
//List<string> listFollowersFromDatabse = new List<string>();
try
{
List<string> listFollowersFromDatabse = new List<string>();
try
{
string screen_Name = Getscreen_Name();
string selectquery = "Select * from tb_FollowerName where UserName='" + screen_Name + "'";
System.Data.DataSet ds = DataBaseHandler.SelectQuery(selectquery, "tb_FollowerName");
foreach (System.Data.DataRow dRow in ds.Tables[0].Rows)
{
try
{
listFollowersFromDatabse.Add(dRow["FollwerName"].ToString());
}
catch { }
}
}
catch { }
try
{
FrmEmailProxyAssigner obj = new FrmEmailProxyAssigner();
string screen_Name = Getscreen_Name();
//Get current followers list from website
List<string> FollowersName = GetRefrshFollowerName(screen_Name);
//FollowersName.RemoveAt(0);
if (FollowersName != null)
{
FollowersName = FollowersName.Distinct().ToList();
}
if (FollowersName.Contains(screen_Name))
{
FollowersName.Remove(screen_Name);
}
//listFollowersFromDatabse.Add("gunde");
List<string> listUnfollowers = listFollowersFromDatabse.Except(FollowersName).ToList();
//.........这里部分代码省略.........