本文整理汇总了C#中BaseLib.GlobusHttpHelper.getHtmlfromUrlProxy方法的典型用法代码示例。如果您正苦于以下问题:C# GlobusHttpHelper.getHtmlfromUrlProxy方法的具体用法?C# GlobusHttpHelper.getHtmlfromUrlProxy怎么用?C# GlobusHttpHelper.getHtmlfromUrlProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseLib.GlobusHttpHelper
的用法示例。
在下文中一共展示了GlobusHttpHelper.getHtmlfromUrlProxy方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckProxy
public bool CheckProxy()
{
try
{
int Working = 0;
string LoggedInIp = string.Empty;
//BaseLib.ChilkatHttpHelpr HttpHelper = new BaseLib.ChilkatHttpHelpr();
//string pageSource = HttpHelper.GetHtmlProxy("http://www.linkedin.com/", proxyAddress, proxyPort, proxyUsername, proxyPassword);
GlobusHttpHelper HttpHelper = new GlobusHttpHelper();
string pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/"), proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);
if (string.IsNullOrEmpty(pageSource))//(string.IsNullOrEmpty(pageSource) && string.IsNullOrEmpty(PgSrcHome))
{
Thread.Sleep(500);
pageSource = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/"), proxyAddress, int.Parse(proxyPort), proxyUsername, proxyPassword);
if (string.IsNullOrEmpty(pageSource))
{
return false;
}
}
///Logic to check...
if (pageSource.Contains("LinkedIn") && (pageSource.Contains("Sign Up")))
{
try
{
using (SQLiteConnection con = new SQLiteConnection(DataBaseHandler.CONstr))
{
using (SQLiteDataAdapter ad = new SQLiteDataAdapter())
{
Working = 1;
string InsertQuery = "Insert into tb_Proxies values('" + proxyAddress + "','" + proxyPort + "','" + proxyUsername + "','" + proxyPassword + "', " + Working + "," + IsPublic + " , '" + LoggedInIp + "')";
DataBaseHandler.InsertQuery(InsertQuery, "tb_Proxies");
GlobusFileHelper.AppendStringToTextfileNewLine(proxyAddress + ":" + proxyPort + ":" + proxyUsername + ":" + proxyPassword, Globals.Path_ExsistingProxies);
}
}
}
catch { }
return true;
}
return false;
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
return false;
}
}
示例2: PostStatusMsg
//.........这里部分代码省略.........
contentTitle = EndContent.Replace("\"", string.Empty).Replace("\n", string.Empty).Replace("share-view-title", string.Empty).Replace("id=", string.Empty).Replace(">", string.Empty).Replace("</h4", string.Empty);
}
catch { }
try
{
int StartinConSumm = GetStatus.IndexOf("share-view-summary\">");
string startConSumm = GetStatus.Substring(StartinConSumm);
int EndIndexConSumm = startConSumm.IndexOf("<");
string EndConSumm = startConSumm.Substring(0, EndIndexConSumm).Replace("value\":", "").Replace("\"", "");
contentSummary = EndConSumm.Replace("\"", string.Empty).Replace("\n", string.Empty).Replace("share-view-summary", string.Empty).Replace("id=", string.Empty).Replace(">", string.Empty).Replace("</span<a href=#", string.Empty).Trim();
contentSummary = contentSummary.Replace(",", "%2C").Replace(" ", "%20");
}
catch { }
string PostStatusData = string.Empty;
if (EntityId == string.Empty)
{
PostStatusData = "ajax=true&contentImageCount=0&contentImageIndex=-1&contentImage=&contentEntityID=&contentUrl=&postText=" + Uri.EscapeDataString(Post) + "&contentTitle=&contentSummary=&contentImageIncluded=true&%23=&postVisibility2=EVERYONE&submitPost=&tetherAccountID=&tweetThisOn=false&postToMFeedDefaultPublic=true&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "";
}
else
{
PostStatusData = "ajax=true&contentImageCount=" + ImgCount + "&contentImageIndex=0&contentImage=" + LogoUrl + "&contentEntityID=" + EntityId + "&contentUrl=" + ReqUrl + "&postText=" + Uri.EscapeDataString(Post) + "&contentTitle=" + contentTitle + "&contentSummary=" + contentSummary + "&contentImageIncluded=true&%23=&postVisibility2=EVERYONE&submitPost=&tetherAccountID=&tweetThisOn=false&postToMFeedDefaultPublic=true&csrfToken=" + Uri.EscapeDataString(csrfToken) + "&sourceAlias=" + sourceAlias + "";
// PostStatusData = "ajax=true&contentImageCount=" + ImgCount + "&contentImageIndex=0&contentImage=http%3A%2F%2Ftimesofindia.indiatimes.com%2Fphoto%2F37174983.cms&contentEntityID=" + EntityId + "&contentUrl=http%3A%2F%2Ftimesofindia.indiatimes.com%2Ftech%2Ftech-news%2FGoogles-Skybox-deal-raises-regulatory-concern%2Farticleshow%2F37174862.cms&mentions=%5B%5D&postText=" + Uri.EscapeDataString(Post) + "&contentTitle=" + contentTitle + "&contentSummary=" + contentSummary + "&contentImageIncluded=true&%23=&postVisibility2=EVERYONE&submitPost=&tetherAccountID=&tweetThisOn=false&postToMFeedDefaultPublic=true&csrfToken=" + Uri.EscapeDataString(csrfToken) + "&sourceAlias=" + sourceAlias + "";
//PostStatusData = "ajax=true&contentImageCount=1&contentImageIndex=0&contentImage=http%3A%2F%2Ftimesofindia.indiatimes.com%2Fphoto%2F37174983.cms&contentEntityID=ARTC_8537949489495079643&contentUrl=http%3A%2F%2Ftimesofindia.indiatimes.com%2Ftech%2Ftech-news%2FGoogles-Skybox-deal-raises-regulatory-concern%2Farticleshow%2F37174862.cms&mentions=%5B%5D&postText=http%3A%2F%2Ftimesofindia.indiatimes.com%2Ftech%2Ftech-news%2FGoogles-Skybox-deal-raises-regulatory-concern%2Farticleshow%2F37174862.cms&share-entity-typeahead=&contentUrl=http%3A%2F%2Ftimesofindia.indiatimes.com%2Ftech%2Ftech-news%2FGoogles-Skybox-deal-raises-regulatory-concern%2Farticleshow%2F37174862.cms&contentImageIncluded=true&contentTitle=Google's%20Skybox%20deal%20raises%20regulatory%20concern%20-%20The%20Times%20of%20India&contentSummary=Consumer%20watchdog%20Public%20Citizen%20has%20called%20on%20US%20regulators%20to%20conduct%20a%20review%20of%20Google%20Inc's%20recent%20acquisition%20of%20aerospace%20startup%20Skybox%20Imaging.&postVisibility2=EVERYONE&tetherAccountID=139016702&submitPost=&isDark=false&tweetThisOn=false&postToMFeedDefaultPublic=true&csrfToken=ajax%3A5539773821497530765&sourceAlias=0_0aUs533-gpztrJxp65YSDh&pageKey=member-home";
}
PostStatusData = PostStatusData.Replace(" ", "");
string ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/nhome/submit-post"), PostStatusData);
Thread.Sleep(2000);
if (ResponseStatusMsg.Contains("There was a problem performing this action, please try again later."))
{
string firstRepsonse = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/share?getPreview=&url=" + Uri.EscapeDataString(Post)), proxyAddress, port, proxyUserName, proxyPassword);
string posturldata = "ajax=true&contentImageCount=0&contentImageIndex=0&contentImage=false&contentEntityID=" + EntityId + "&contentUrl=" + ReqUrl + "&postText=" + Uri.EscapeDataString(Post) + "&contentUrl=" + Uri.EscapeDataString(Post) + "&contentTitle=" + contentTitle + "&contentSummary=" + contentSummary + "&postVisibility2=EVERYONE&submitPost=&tetherAccountID=&tweetThisOn=false&postToMFeedDefaultPublic=true&csrfToken=" + Uri.EscapeDataString(csrfToken) + "&sourceAlias=" + sourceAlias;
ResponseStatusMsg = HttpHelper.postFormDataProxy(new Uri("http://www.linkedin.com/nhome/submit-post"), posturldata, proxyAddress, port, proxyUserName, proxyPassword);
}
if (ResponseStatusMsg.Contains("Your update has been posted") || ResponseStatusMsg.Contains("success"))
{
if (Statuswithurl == true)
{
Log("[ " + DateTime.Now + " ] => [ URL Status Updated With: " + accountUser + " ]");
Log("[ " + DateTime.Now + " ] => [ URL Status Posted: " + Post + " ]");
Log("[ " + DateTime.Now + " ] => [ URL Status : Updated Successfully. ]");
}
else
{
Log("[ " + DateTime.Now + " ] => [ Status Updated With: " + accountUser + " ]");
Log("[ " + DateTime.Now + " ] => [ Status Posted: " + Post + " ]");
Log("[ " + DateTime.Now + " ] => [ Status : Updated Successfully. ]");
}
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + Post, Globals.path_PostStatus);
}
else if (ResponseStatusMsg.Contains("You have exceeded the maximum length by 965 character(s)."))
{
Log("[ " + DateTime.Now + " ] => [ " + accountUser + " You have exceeded the maximum length by 965 character(s). ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + Post, Globals.path_NonPostStatus);
}
else if (ResponseStatusMsg.Contains("We were unable to post your update since it is a duplicate of your most recent update"))
{
Log("[ " + DateTime.Now + " ] => [ " + accountUser + " We were unable to post your update since it is a duplicate of your most recent update ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + Post, Globals.path_NonPostStatus);
}
else
示例3: LoginHttpHelper_Checker
public void LoginHttpHelper_Checker(ref GlobusHttpHelper HttpHelper)
{
try
{
this.HttpHelper = HttpHelper;
//Log("[ " + DateTime.Now + " ] => [ Logging In With Account : " + SearchCriteria.LoginID + " ]");
Log("[ " + DateTime.Now + " ] => [ Logging In With Account : " + accountUser + " ]");
Log("[ " + DateTime.Now + " ] => [ Login Process is Running... ]");
Url = "https://www.linkedin.com/";
string pageSrcLogin = string.Empty;
int ProxyPort = 0;
if (!string.IsNullOrEmpty(proxyPort) && NumberHelper.ValidateNumber(proxyPort))
{
ProxyPort = int.Parse(proxyPort);
}
pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, ProxyPort, proxyUserName, proxyPassword);
string postdata = string.Empty;
string postUrl = string.Empty;
string ResLogin = string.Empty;
string csrfToken = string.Empty;
string regCsrfParam = string.Empty;
string sourceAlias = string.Empty;
if (pageSrcLogin.Contains("csrfToken"))
{
try
{
int startIndex = pageSrcLogin.IndexOf("name=\"csrfToken\"");
string start = pageSrcLogin.Substring(startIndex).Replace("name=\"csrfToken\"", "");
int endIndex = start.IndexOf("\" ");
string end = start.Substring(0, endIndex).Replace("value=\"", "").Trim();
csrfToken = end;
//csrfToken = csrfToken;
}
catch (Exception ex)
{
}
}
try
{
if (csrfToken.Contains("&"))
{
string[] Arr = csrfToken.Split('&');
csrfToken = Arr[0].Replace("\"", string.Empty);
}
}
catch { }
if (pageSrcLogin.Contains("sourceAlias"))
{
sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
string[] Arr = sourceAlias.Split('"');
sourceAlias = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty).Trim();
}
try
{
int SourceAliasStart = pageSrcLogin.IndexOf("regCsrfParam");
if (SourceAliasStart > 0)
{
try
{
regCsrfParam = pageSrcLogin.Substring(pageSrcLogin.IndexOf("regCsrfParam"), 100);
string[] Arr = regCsrfParam.Split('"');
regCsrfParam = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
}
catch
{
}
}
}
catch { }
postUrl = "https://www.linkedin.com/uas/login-submit";
postdata = "isJsEnabled=true&source_app=&tryCount=&session_key=" + Uri.EscapeDataString(accountUser) + "&session_password=" + Uri.EscapeDataString(accountPass) + "&signin=Sign%20In&session_redirect=&loginCsrfParam=" + regCsrfParam + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
try
{
ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, proxyAddress, ProxyPort, proxyUserName, proxyPassword);//HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "http://www.linkedin.com/uas/login?goback=&trk=hb_signin", "", "");
}
catch { }
//if (GroupStatus.GrouppageSourcewithProxy == string.Empty)
//{
// GroupStatus.GrouppageSourcewithProxy = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/grp/"));
//}
string ImageUrl = string.Empty;
string captchaText = string.Empty;
string captchachallengeid = string.Empty;
string dts = string.Empty;
//.........这里部分代码省略.........
示例4: LoginHttpHelper
public void LoginHttpHelper(ref GlobusHttpHelper HttpHelper, string userName, string password, string Proxyaddress, string ProxyUserName, string ProxyPass, string port)
{
try
{
this.accountUser = userName;
this.accountPass = password;
this.proxyAddress = Proxyaddress;
this.proxyPassword = ProxyPass;
this.proxyUserName = ProxyUserName;
this.proxyPort = port;
Log("[ " + DateTime.Now + " ] => [ Logging In With : " + accountUser + " ]");
Log("[ " + DateTime.Now + " ] => [ Login Process is Running... ]");
Url = "https://www.linkedin.com/";
string pageSrcLogin = string.Empty;
if (string.IsNullOrEmpty(proxyPort))
{
proxyPort = (0).ToString();
}
pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, Convert.ToInt32(proxyPort), proxyUserName, proxyPassword);
string postdata = string.Empty;
string postUrl = string.Empty;
string ResLogin = string.Empty;
string csrfToken = string.Empty;
string sourceAlias = string.Empty;
if (pageSrcLogin.Contains("csrfToken"))
{
int startCsrfToken = pageSrcLogin.IndexOf("name=\"csrfToken\"");
if (startCsrfToken > 0)
{
string startcsrfToken = pageSrcLogin.Substring(startCsrfToken).Replace("name=\"csrfToken\"", "").Replace("value=\"", "");
int endCsrfToken = startcsrfToken.IndexOf("\"");
string endcsrftoken = startcsrfToken.Substring(0, endCsrfToken);
csrfToken = endcsrftoken.Replace(@"\", string.Empty).Replace("//", string.Empty).Replace(" ", "");
}
}
if (pageSrcLogin.Contains("sourceAlias"))
{
sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
string[] Arr = sourceAlias.Split('"');
sourceAlias = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
}
postUrl = "https://www.linkedin.com/uas/login-submit";
postdata = "session_key=" + accountUser + "&session_password=" + accountPass + "&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
//ResLogin = HttpHelper.postFormData(new Uri(postUrl), postdata);
ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata, proxyAddress, int.Parse(proxyPort), proxyUserName, proxyPassword);
if (ResLogin.Contains("Sign Out") && ResLogin.Contains("class=\"signout\""))
{
IsLoggedIn = true;
Log("[ " + DateTime.Now + " ] => [ Logged In With Account : " + accountUser + " ]");
string Search = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/search?trk=advsrch"));
SearchCriteria.loginREsponce = Search;
}
#region MyRegion
//Url = "http://www.linkedin.com/home?trk=hb_tab_home_top";
//pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, 888, proxyUserName, proxyPassword);
//LogoutHttpHelper(ref HttpHelper);
//Url = "http://www.linkedin.com/home?trk=hb_tab_home_top";
//pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), proxyAddress, 888, proxyUserName, proxyPassword);
#endregion
}
catch (Exception ex)
{
}
}
示例5: ResendConfirmation
public void ResendConfirmation(ref GlobusHttpHelper HttpHelper)
{
string postdata = string.Empty;
string postUrl = string.Empty;
string ResLogin = string.Empty;
string csrfToken = string.Empty;
string emailid = string.Empty;
try
{
Log("[ " + DateTime.Now + " ] => [ Starting Sending Invitation To Account : " + accountUser + " ]");
if (!NumberHelper.ValidateNumber(proxyPort))
{
proxyPort = "0";
}
string GetHomePageSOurce = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/settings/manage-email?goback=%2Enas_*1_*1_*1%2Enas_profile_nsettings*5manage*5email_*1"), proxyAddress, int.Parse(proxyPort), proxyUserName, proxyPassword);
string LinkToVerfiy = string.Empty;
if (GetHomePageSOurce.Contains(accountUser) && !GetHomePageSOurce.Contains("Primary address"))
//if (GetHomePageSOurce.Contains(accountUser))
{
try
{
if (GetHomePageSOurce.Contains("csrfToken"))
{
csrfToken = GetHomePageSOurce.Substring(GetHomePageSOurce.IndexOf("csrfToken"), 100);
string[] Arr = csrfToken.Split('"');
try
{
csrfToken = Arr[2].Replace(@"\", string.Empty).Replace("//", string.Empty);
}
catch (Exception ex)
{
csrfToken = Arr[0].Replace("csrfToken=", "").Replace("\\", "");
}
try
{
if (csrfToken.Contains("&"))
{
string[] Arr1 = csrfToken.Split('&');
csrfToken = Arr1[0].Replace("\"", string.Empty);
}
}
catch { }
}
if (GetHomePageSOurce.Contains("entry primary") || GetHomePageSOurce.Contains("CHOOSE YOUR PRIMARY EMAIL ADDRESS"))
{
try
{
emailid = GetHomePageSOurce.Substring(GetHomePageSOurce.IndexOf("truncated-"), (GetHomePageSOurce.IndexOf("callout-content") - GetHomePageSOurce.IndexOf("truncated-")));
emailid = emailid.Replace("truncated-", string.Empty).Replace(">",string.Empty).Replace("class=",string.Empty).Replace("callout-container",string.Empty).Replace("email",string.Empty).Replace("style=",string.Empty).Replace("display: none",string.Empty).Replace("\"",string.Empty).Replace("\n",string.Empty).Replace("<div",string.Empty).Trim();
}
catch { }
}
postdata = "https://www.linkedin.com/settings/manageEmailConfirmation-submit?emailID=" + emailid.Replace(" ", "") + "&csrfToken=" + csrfToken + "&goback=%2Enas_*1_*1_*1%2Enas_*1_*1_*1%2Enas_profile_nsettings*5manage*5email_*1";
ResLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(postdata), proxyAddress, int.Parse(proxyPort), proxyUserName, proxyPassword);
if (ResLogin.Contains("We've sent a confirmation email to") || ResLogin.Contains("\"status\":\"ok\"}") || ResLogin.Contains("find the email from LinkedIn, and click the confirm button"))
{
Log("[ " + DateTime.Now + " ] => [ Resent Confirmation To Account : " + accountUser + " ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_ResentVerfication);
}
else
{
Log("[ " + DateTime.Now + " ] => [ Confirmation Not Sent To Account : " + accountUser + " ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_NonResentVerfication);
}
}
catch (Exception ex)
{
Log("[ " + DateTime.Now + " ] => [ Error in Sending Confirmation , Not Sent To Account : " + accountUser + " ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_NonResentVerfication);
}
}
else
{
Log("[ " + DateTime.Now + " ] => [ Email Already Verfied For Account : " + accountUser + " ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_NonResentVerfication);
}
}
catch (Exception ex)
{
Log("[ " + DateTime.Now + " ] => [ Error in Sending Confirmation , Not Sent To Account : " + accountUser + " ]");
GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_NonResentVerfication);
}
Log("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED With Account : " + accountUser + " ]");
Log("-----------------------------------------------------------------------------------------------------------------------------------");
}
示例6: GetCaptch
private string GetCaptch(string TempCreatingAccountPageSource)
{
string captcha = string.Empty;
try
{
string GetURLforcaptcha = string.Empty;
string CaptchaChallenge = string.Empty;
string proxyAddress = string.Empty;
string ProxyPort = "0";
string proxyUsername = string.Empty;
string proxyPassword = string.Empty;
GlobusHttpHelper GlobusHttpHelper = new GlobusHttpHelper();
#region GetURLCapcha
if (TempCreatingAccountPageSource.Contains("https://www.google.com/recaptcha/api/challenge"))
{
try
{
string CaptchaReq = TempCreatingAccountPageSource.Substring(TempCreatingAccountPageSource.IndexOf("https://www.google.com/recaptcha/api/challenge"), 120);
string[] CaptchaReqIDArrry = CaptchaReq.Split('"');
GetURLforcaptcha = CaptchaReqIDArrry[0];
}
catch
{
}
}
#endregion
#region CapchaChallenge
if (!string.IsNullOrEmpty(GetURLforcaptcha))
{
string PagesourceForCapchafterGetreq = GlobusHttpHelper.getHtmlfromUrlProxy(new Uri(GetURLforcaptcha), proxyAddress, Convert.ToInt32(ProxyPort), proxyUsername, proxyPassword);
if (PagesourceForCapchafterGetreq.Contains("challenge :"))
{
try
{
int startIndx = PagesourceForCapchafterGetreq.IndexOf("challenge :") + "challenge :".Length;
int endIndx = PagesourceForCapchafterGetreq.IndexOf("'", startIndx + 10);
CaptchaChallenge = PagesourceForCapchafterGetreq.Substring(startIndx, endIndx - startIndx).Replace("'", "").Trim();
//string CaptchaSecondReq = PagesourceForCapchafterGetreq.Substring(PagesourceForCapchafterGetreq.IndexOf("challenge :"), PagesourceForCapchafterGetreq.IndexOf("'", PagesourceForCapchafterGetreq.IndexOf("challenge :") + 10));
////string[] CaptchaSecondReqIDArrry = CaptchaSecondReq.Split(',');
//CaptchaChallenge = CaptchaSecondReq.Replace("challenge : ", "").Replace("'", "");
}
catch
{
}
}
}
#endregion
if (!string.IsNullOrEmpty(GetURLforcaptcha))
{
#region For With Capcha Account Creation
try
{
string abc = "https://www.google.com/recaptcha/api/image?c=" + CaptchaChallenge;
//string TepGetCapcha = GlobusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.google.com/recaptcha/api/image?c="+CaptchaChallenge), proxyAddress, ProxyPort, proxyUsername, proxyPassword);
//for decaptcha..
int count_refreshcaptcha = 0;
WebClient webclient = new WebClient();
byte[] args = webclient.DownloadData(abc);
string captchaText = string.Empty;
string[] arr1 = new string[] { Globals.CapchaLoginID, Globals.CapchaLoginPassword, "" };
captchaText = DecodeDBC(arr1, args);
captcha = captchaText;
}
catch
{
}
#endregion
}
}
catch
{
}
return captcha;
}
示例7: CheckProxy
//New method added by Lijo John 16/10/2014
public bool CheckProxy(string IPAddress, int Port, string Username, string Password, string URL)
{
GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper();
bool status = false;
try
{
System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
string ResponseTime = string.Empty;
timer.Start();
string Response = objGlobusHttpHelper.getHtmlfromUrlProxy(new Uri(URL),IPAddress,Port,Username,Password);
timer.Stop();
TimeSpan timeTaken = timer.Elapsed;
ResponseTime = timeTaken.ToString();
if (string.IsNullOrEmpty(Response))
{
timeTaken = new TimeSpan();
timer.Start();
Response = objGlobusHttpHelper.getHtmlfromUrlProxy(new Uri(URL), IPAddress, Port, Username, Password);
timer.Stop();
timeTaken = timer.Elapsed;
ResponseTime = timeTaken.ToString();
}
if (!string.IsNullOrEmpty(Response) && !Response.Contains("Internet Explorer cannot display the webpage"))
{
status = true;
}
else
{
status = false;
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error(ex.StackTrace);
}
return status;
}
示例8: LoginHttpHelper
public void LoginHttpHelper(ref GlobusHttpHelper HttpHelper)
{
try
{
Log("[ " + DateTime.Now + " ] => [ Logging In With : " + _Username + " ]");
Log("[ " + DateTime.Now + " ] => [ Login Process is Running... ]");
//Check Login
if (IsLoggedIn)
{
try
{
string homePage = HttpHelper.getHtmlfromUrlProxy(new Uri("http://www.linkedin.com/home"), _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword);
if (homePage.Contains("Sign Out") && homePage.Contains("class=\"signout\"") && !homePage.Contains("Your LinkedIn account has been temporarily restricted"))
{
Log("[ " + DateTime.Now + " ] => [ Already Logged In With : " + _Username + " ]");
return;
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
string Url = "https://www.linkedin.com/";
////string pageSrcLogin = HttpChilkat.GetHtmlProxy(Url, proxyAddress, proxyPort, proxyUserName, proxyPassword);
string pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword);
if (string.IsNullOrEmpty(pageSrcLogin))
{
try
{
System.Threading.Thread.Sleep(1000);
pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, int.Parse(_ProxyPort), _ProxyUsername, _ProxyPassword, "");
}
catch
{
}
}
if (string.IsNullOrEmpty(pageSrcLogin))
{
Log("[ " + DateTime.Now + " ] => [ Couldn't Login In With : " + _Username + " ]");
return;
}
string postdata = string.Empty;
string postUrl = string.Empty;
string ResLogin = string.Empty;
string csrfToken = string.Empty;
string sourceAlias = string.Empty;
string regCsrfParam = string.Empty;
if (pageSrcLogin.Contains("csrfToken"))
{
try
{
int startindex = pageSrcLogin.IndexOf("name=\"csrfToken\"");
if (startindex > 0)
{
string start = pageSrcLogin.Substring(startindex).Replace("name=\"csrfToken\"", "");
int endindex = start.IndexOf("\" ");
string end = start.Substring(0, endindex);
csrfToken = end.Replace("value=\"", "").Replace("\\", "").Replace(" ", "");
csrfToken = Uri.EscapeDataString(csrfToken);
}
else
{
string[] Arr = csrfToken.Split('"');
csrfToken = Arr[2].Replace("\\", string.Empty);
}
}
catch
{
try
{
csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
if (csrfToken.Contains("&"))
{
string[] Arr = csrfToken.Split('&');
csrfToken = Arr[0];
}
else if (csrfToken.Contains(","))
{
string[] Arr = csrfToken.Split(',');
csrfToken = Arr[0].Replace("\\", string.Empty);
}
else
{
string[] Arr = csrfToken.Split(',');
csrfToken = Arr[0].Replace("\\", string.Empty).Replace("csrfToken=", "").Replace("\n", "").Replace("\">", "");
}
}
catch { }
}
}
try
//.........这里部分代码省略.........
示例9: LoginHttpHelper
public bool LoginHttpHelper(string username, string password, string proxyaddress, string proxyport, string proxyusername, string proxypassword, ref GlobusHttpHelper HttpHelper, ref string Message)
{
bool isLoggin = false;
try
{
// LoggerLoginLogout("Logging Block.............");
string Url = string.Empty;
int port = 888;
Regex PortCheck = new Regex("^[0-9]*$");
_AccountUser = username;
_AccountPass = password;
_ProxyAddress = proxyaddress;
_ProxyPort = proxyport;
_ProxyUserName = proxyusername;
_ProxyPassword = proxypassword;
if (PortCheck.IsMatch(_ProxyPort) && !string.IsNullOrEmpty(_ProxyPort))
{
port = int.Parse(_ProxyPort);
}
if (string.IsNullOrEmpty(_ProxyPort))
{
_ProxyPort = "0";
}
Url = "https://www.linkedin.com/";
// string pageSrcLogin = HttpChilkat.GetHtmlProxy(Url, proxyAddress, proxyPort, proxyUserName, proxyPassword);
string pageSrcLogin = string.Empty;
try
{
pageSrcLogin = HttpHelper.getHtmlfromUrlProxy(new Uri(Url), _ProxyAddress, (port), _ProxyUserName, _ProxyPassword);//HttpHelper.getHtmlfromUrl(new Uri(Url));
}
catch { }
string postdata = string.Empty;
string postUrl = string.Empty;
string ResLogin = string.Empty;
string csrfToken = string.Empty;
string sourceAlias = string.Empty;
string regCsrfParam = string.Empty;
#region commented
//if (pageSrcLogin.Contains("csrfToken"))
//{
// try
// {
// csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
// string[] Arr = csrfToken.Split('"');
// csrfToken = Arr[2].Replace("\\",string.Empty).Replace("\"",string.Empty).Trim();
// }
// catch
// {
// try
// {
// csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
// string[] Arr = csrfToken.Split('&');
// csrfToken = Arr[0].Replace("\\", string.Empty).Replace("\"", string.Empty).Replace("csrfToken=", "").Replace(">",string.Empty).Trim();
// }
// catch
// {
// try
// {
// csrfToken = pageSrcLogin.Substring(pageSrcLogin.IndexOf("csrfToken"), 100);
// string[] Arr = csrfToken.Split(',');
// csrfToken = Arr[0].Replace("\\", string.Empty).Replace("\"", string.Empty).Replace("csrfToken=", "").Replace(">", string.Empty).Trim();
// }
// catch { }
// }
// }
//}
//if (csrfToken.Contains(">") && csrfToken.Contains("csrfToken="))
//{
// try
// {
// csrfToken = csrfToken.Substring(csrfToken.IndexOf("ajax"), csrfToken.IndexOf(">") - csrfToken.IndexOf("ajax")).Replace("csrfToken=", "").Trim();
// }
// catch { }
//}
//if (pageSrcLogin.Contains("sourceAlias"))
//{
// try
// {
// sourceAlias = pageSrcLogin.Substring(pageSrcLogin.IndexOf("sourceAlias"), 100);
// string[] Arr = sourceAlias.Split('"');
// sourceAlias = Arr[2].Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
// }
// catch { }
//}
////_AccountUser = "[email protected]";
////_AccountPass = "globussoft";
//.........这里部分代码省略.........
示例10: EndorsingPeople
public void EndorsingPeople(ref GlobusHttpHelper HttpHelper, string UserId)
{
try
{
int count = 0;
int ProxyPort = 0;
if (!string.IsNullOrEmpty(proxyPort) && NumberHelper.ValidateNumber(proxyPort))
{
ProxyPort = Convert.ToInt32(proxyPort);
}
string EndorseLink = string.Empty;
string modelNo = string.Empty;
string csrfToken = string.Empty;
string postdata = string.Empty;
string _ed = string.Empty;
string endorseUrl = string.Empty;
string Link = string.Empty;
string LinkSource = string.Empty;
string PageSourceProfile = string.Empty;
try
{
Globals.tempDict.Add(UserId, "");
Log("[ " + DateTime.Now + " ] => [ Starting Getting Member Details For User Id Link - :" + UserId + " With : " + Username + " ]");
}
catch
{
}
if (!UserId.Contains("http"))
{
Link = "http://www.linkedin.com/people/conn-details?i=&contactMemberID=" + UserId;
PageSourceProfile = HttpHelper.getHtmlfromUrlProxy(new Uri(Link), proxyAddress, 0, proxyUsername, proxyPassword);
try
{
int startindex = PageSourceProfile.IndexOf("/profile/view?id=");
if (startindex > 0)
{
string start = PageSourceProfile.Substring(startindex);
int endIndex = start.IndexOf("\">");
string end = start.Substring(0, endIndex).Replace("\\", "").Replace("&", "&");
if (end.Contains("&trk"))
{
end = end.Split('&')[0].ToString();
}
LinkSource = "http://www.linkedin.com" + end;
}
}
catch (Exception ex)
{
GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error -->EndorsingPeople() --> LinkSource >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.Path_LinkedinErrorLogs);
GlobusFileHelper.AppendStringToTextfileNewLine("DateTime :- " + DateTime.Now + " :: Error --> EndorsingPeople() --> LinkSource >>>> " + ex.Message + "StackTrace --> >>>" + ex.StackTrace, Globals.path_EndorsePeople);
}
if (string.IsNullOrEmpty(UserId))
{
try
{
Globals.tempDict.Add(UserId, "");
Log("[ " + DateTime.Now + " ] => [ Cannot Find Data For Userid : " + UserId + " From " + Username + " ]");
return;
}
catch
{ }
}
PageSourceProfile = HttpHelper.getHtmlfromUrlProxy(new Uri(LinkSource), proxyAddress, 0, proxyUsername, proxyPassword);
}
else
{
Link = UserId;
PageSourceProfile = HttpHelper.getHtmlfromUrlProxy(new Uri(Link), proxyAddress, 0, proxyUsername, proxyPassword);
}
if (PageSourceProfile.Contains("csrfToken"))
{
csrfToken = PageSourceProfile.Substring(PageSourceProfile.IndexOf("csrfToken"), 100);
string[] Arr = csrfToken.Split('&');
try
{
csrfToken = Arr[0].Replace("csrfToken=", "").Replace("\\", "");
csrfToken = csrfToken.Split('>')[0].Replace(">", string.Empty).Replace("\"",string.Empty);
}
catch (Exception ex)
{
csrfToken = Arr[0].Replace("csrfToken=", "").Replace("\\", "");
}
//csrfToken
if (csrfToken.Contains("updateTagsUrl"))
{
csrfToken = csrfToken.Split(',')[0].ToString();
}
//.........这里部分代码省略.........
示例11: StartActionVerifyAccount
private void StartActionVerifyAccount(ref InstagramUser IgUser)
{
lock (this)
{
try
{
if (isStopVerifingAccount)
{
return;
}
try
{
listOfWorkingThread.Add(Thread.CurrentThread);
listOfWorkingThread = listOfWorkingThread.Distinct().ToList();
Thread.CurrentThread.IsBackground = true;
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error ==> " + ex.Message);
}
if (listOfAccount.Count > 0)
{
//if (string.IsNullOrEmpty(usernameOfAPI) || string.IsNullOrEmpty(passwordOfAPI))
//{
// // GlobusLogHelper.log.Info("Please Enter Username And Password Of API");
//}
//else
{
if (string.IsNullOrEmpty(IgUser.proxyport))
{
IgUser.proxyport = "80";
}
/// login to Api
///
string homePageResponse = IgUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.instagram.com/"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword); //https://www.instagram.com/integrity/checkpoint/?next=%2F
string securityCheckPagesource = IgUser.globusHttpHelper.getHtmlfromUrlProxy(new Uri("https://www.instagram.com/integrity/checkpoint/?next=%2F"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);
if (securityCheckPagesource.Contains("Enter your phone number. We'll text you a security code to make sure it's you."))
{
startAgain:
GlobusHttpHelper objGlobusshttphelper = new GlobusHttpHelper();
Queue<string> queueOfMobileNo = new Queue<string>();
Queue<string> queueOfMobileNoUrl = new Queue<string>();
string MobileNoHomePageSource = objGlobusshttphelper.getHtmlfromUrlProxy(new Uri("http://www.receive-sms-online.info/"), IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);
try
{
string[] getAllNumberDetails = System.Text.RegularExpressions.Regex.Split(MobileNoHomePageSource, "<a href=");
if (getAllNumberDetails.Count() > 0)
{
foreach (string item in getAllNumberDetails)
{
if (item.Contains("read-sms.php") && item.Contains("Receive SMS USA"))
{
string mobileNo = string.Empty;
string mobileNourl = string.Empty;
mobileNourl = "http://www.receive-sms-online.info/" + Utils.getBetween(item, "\"", "\"");
mobileNo = Utils.getBetween(item, "phone=", "\"");
queueOfMobileNoUrl.Enqueue(mobileNourl);
queueOfMobileNo.Enqueue(mobileNo);
}
else
{
continue;
}
}
}
}
catch (Exception ex)
{
GlobusLogHelper.log.Error("Error : " + ex.Message);
}
if (queueOfMobileNoUrl.Count > 0)
{
foreach (string item in queueOfMobileNoUrl)
{
try
{
string phoneNo = queueOfMobileNo.Dequeue();
string getcsrfmiddlewaretoken = Utils.getBetween(securityCheckPagesource, "csrfmiddlewaretoken\" value=\"", "\"");
string phoneNoPostData = "csrfmiddlewaretoken=" + getcsrfmiddlewaretoken + "&phone_number=%2B" + phoneNo;
string postUrl = "https://www.instagram.com/integrity/checkpoint/?next=%2F";
string smsActivationPagesource = IgUser.globusHttpHelper.postFormDataProxy(new Uri(postUrl), phoneNoPostData, "https://www.instagram.com/integrity/checkpoint/?next=%2F ", "", "https://www.instagram.com", IgUser.proxyip, int.Parse(IgUser.proxyport), IgUser.proxyusername, IgUser.proxypassword);
if (smsActivationPagesource.Contains("Sorry, please choose a different phone number"))
{
continue;
}
var driverervice = PhantomJSDriverService.CreateDefaultService();
driverervice.HideCommandPromptWindow = true;
//.........这里部分代码省略.........