当前位置: 首页>>代码示例>>C#>>正文


C# BaseLib.GlobusHttpHelper类代码示例

本文整理汇总了C#中BaseLib.GlobusHttpHelper的典型用法代码示例。如果您正苦于以下问题:C# GlobusHttpHelper类的具体用法?C# GlobusHttpHelper怎么用?C# GlobusHttpHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GlobusHttpHelper类属于BaseLib命名空间,在下文中一共展示了GlobusHttpHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DecodeGetCharector

        public static string DecodeGetCharector(string PageString)
        {
            GlobusHttpHelper obj_http = new GlobusHttpHelper();
            string GetOrginalString = string.Empty;
            try
            {
                string[] Arr = System.Text.RegularExpressions.Regex.Split(PageString, "&#");
                foreach (var item_Arr in Arr)
                {
                    try
                    {

                        string ss = string.Empty;

                        ss = "&#" + Uri.EscapeDataString(Utils.getBetween("&#" + item_Arr, "&#", ";")) + ";";
                        string Url = "http://chars.suikawiki.org/string?s=" +Uri.EscapeDataString(ss);

                        string PageSource = obj_http.getHtmlfromUrl(new Uri(Url));
                        string[] Arr11 = System.Text.RegularExpressions.Regex.Split(PageSource, "escapes");

                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                }

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }

            return GetOrginalString;
        }
开发者ID:shah8701,项目名称:faceboard,代码行数:35,代码来源:Utils.cs

示例2: CheckLDAccount

        public void CheckLDAccount(string item)
        {
            GlobusHttpHelper objGlobusHttpHelper = new GlobusHttpHelper();

            try
            {
                _Email = item;

                string Username = string.Empty;
                string Password = string.Empty;
                string proxyAddress = string.Empty;
                string proxyPort = string.Empty;
                string proxyUserName = string.Empty;
                string proxyPassword = string.Empty;

                string account = item;
                string[] AccArr = account.Split(':');
                if (AccArr.Count() > 1)
                {
                    Username = account.Split(':')[0];
                    Password = account.Split(':')[1];
                    int DataCount = account.Split(':').Length;

                    if (DataCount == 4)
                    {
                        proxyAddress = account.Split(':')[2];
                        proxyPort = account.Split(':')[3];
                    }
                    else if (DataCount == 6)
                    {
                        proxyAddress = account.Split(':')[2];
                        proxyPort = account.Split(':')[3];
                        proxyUserName = account.Split(':')[4];
                        proxyPassword = account.Split(':')[5];
                    }
                }

                LinkedinLogin Login = new LinkedinLogin();
                //For Sign Out +9+
                Login.LoginHttpHelper(ref objGlobusHttpHelper);

                //bool isLogin = LoginAccount(Username, Password, proxyAddress, proxyPort, proxyUserName, proxyPassword);
            }
            catch
            {

            }
            finally
            {
                Counter++;
                if (TotalEmails <= Counter)
                {
                    Log("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED For Account Checking ]");
                    Log("------------------------------------------------------------------------------------------------------------------------------------");
                }
            }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:57,代码来源:CheckAccount.cs

示例3: GetProfileId

 public string GetProfileId(ref GlobusHttpHelper httpHelper, string loggedInPageSource)
 {
     string profileId = string.Empty;
     try
     {
         //profileId = httpHelper.GetUniqueKeyBasedValue(loggedInPageSource, "user_id:");
         profileId = httpHelper.GetUniqueKeyBasedValue(loggedInPageSource, "<li class=\"nav-item account-settings-tab\">");
     }
     catch
     {
     }
     return profileId;
 }
开发者ID:brentscheidt,项目名称:inboard,代码行数:13,代码来源:LinkedinProfileImgUploader.cs

示例4: 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;
            }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:51,代码来源:ProxyCheker.cs

示例5: SetProfilePic

        public void SetProfilePic(ref GlobusHttpHelper httpHelper)
        {
            try
            {
                string homePageSource = httpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com"));
                string ProfileID = GetProfileId(ref httpHelper, homePageSource);
                string Url = "http://www.linkedin.com/profile/view?id=" + ProfileID + "&trk=tab_pro";
                string ProfilePageSource = httpHelper.getHtmlfromUrl1(new Uri(Url));

                if (!string.IsNullOrEmpty(homePageSource))
                {
                    try
                    {
                        if (ProfilePageSource.Contains("link__nprofileEdit"))
                        {
                            try
                            {
                                string link__nprofileEdit = httpHelper.GetUniqueKeyBasedValue(ProfilePageSource, "link__nprofileEdit");
                            }
                            catch { }
                        }

                        if (ProfilePageSource.Contains("link__editPictureInfo"))
                        {
                            try
                            {
                                string link__editPictureInfo = httpHelper.GetUniqueKeyBasedValue(ProfilePageSource, "link__editPictureInfo");
                            }
                            catch { }
                        }
                        string refere = string.Empty;
                        try
                        {
                            UploadPic(ref httpHelper, ProfilePageSource, refere);
                        }
                        catch { }

                    }
                    catch { }
                }
            }
            catch { }

            finally
            {
                Log("[ " + DateTime.Now + " ] => [ PROCESS COMPLETED ]");
                Log("--------------------------------------------------------------------------------------------------------------------------------------------");
            }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:49,代码来源:LinkedinProfileImgUploader.cs

示例6: getAllMembers

        public Dictionary<string, string> getAllMembers(ref GlobusHttpHelper HttpHelper, string userName)
        {
            Dictionary<string, string> details = new Dictionary<string, string>();
            try
            {
                string url = "https://www.linkedin.com/people/invites?trk=connect_hub_manage_invitations_sent";
                string src = HttpHelper.getHtmlfromUrl(new Uri(url));
                if (src.Contains("{\"lastName\""))
                {
                    string[] arr = Regex.Split(src, "{\"lastName\"");
                    foreach (string item in arr)
                    {
                        try
                        {
                            if (!item.Contains("<!DOCTYPE"))
                            {
                                string invitationId=string.Empty;
                                string Id=string.Empty;
                                string fullName = Utils.getBetween(item, "i18n_check_to_remove\":\"","\",");
                                fullName = Utils.getBetween(fullName + "###", "to remove", "###");
                                fullName= fullName.Trim();
                                if (item.Contains(""))
                                {
                                    invitationId = Utils.getBetween(item, "\"invitationId\":\"", "\",\"");
                                }
                                if (item.Contains("memberId\":"))
                                {
                                    Id = Utils.getBetween(item, "memberId\":", "}");
                                }
                                Id = userName + ":" + Id;
                                details.Add(Id, fullName + ":" + invitationId);

                            }
                        }
                        catch
                        { }
                    }

                }
            }
            catch
            { }
            return details;
        }
开发者ID:sumitglobussoft,项目名称:LinkedDominator-3.0,代码行数:44,代码来源:WithdrawConnectionInvitation.cs

示例7: LogoutHttpHelper

        public bool LogoutHttpHelper(ref GlobusHttpHelper HttpHelper)
        {
            try
            {
                //string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/"));
                string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/"));
                if (pageSource1.Contains("\"h\"") && pageSource1.Contains("post_form_id") && pageSource1.Contains("fb_dtsg"))
                {
                    string h = string.Empty;
                    string post_form_id = string.Empty;
                    string fb_dtsg = string.Empty;

                    if (pageSource1.Contains("\"h\""))
                    {
                        string strTemp = pageSource1.Substring(pageSource1.IndexOf("\"h\""), 200);
                        string[] ArrTemp = strTemp.Split('"');
                        h = ArrTemp[3];
                    }
                    if (pageSource1.Contains("post_form_id") && pageSource1.Contains("fb_dtsg"))
                    {
                        string strTemp = pageSource1.Substring(pageSource1.IndexOf("post_form_id"), 200);
                        string[] ArrTemp = strTemp.Split('"');
                        post_form_id = ArrTemp[2];
                        fb_dtsg = ArrTemp[6];

                    }

                    string ResponseLogout = HttpHelper.postFormData(new Uri("http://www.facebook.com/logout.php"), "post_form_id=" + post_form_id + "&fb_dtsg=" + fb_dtsg + "&ref=mb&h=" + h);
                    return true;
                }
                return false;
            }
            catch (Exception ex)
            {
                return false;
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:38,代码来源:LogOutAccount.cs

示例8: GetGroupMemberInfo

 public void GetGroupMemberInfo(ref GlobusHttpHelper httpHelper, List<string> lstGrpMemProfileURLs)
 {
     try
     {
         foreach (string item in lstGrpMemProfileURLs)
         {
             try
             {
                 if (!CrawlingLinkedInPage(item, ref httpHelper))
                 {
                     CrawlingPageDataSource(item, ref httpHelper);
                 }
             }
             catch (Exception ex)
             {
                 Console.WriteLine("Error : " + ex.StackTrace);
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error : " + ex.StackTrace);
     }
 }
开发者ID:brentscheidt,项目名称:inboard,代码行数:24,代码来源:ClsScrapGroupMember.cs

示例9: CrawlingPageDataSource

        public void CrawlingPageDataSource(string Url, ref GlobusHttpHelper HttpHelper)
        {
            // if (SearchCriteria.starter)
            {
                // if (SearchCriteria.starter)
                {
                    try
                    {
                        Log("[ " + DateTime.Now + " ] => [ Start Parsing Process ]");

                        #region Data Initialization

                        string Industry = string.Empty;
                        string URLprofile = string.Empty;
                        string firstname = string.Empty;
                        string lastname = string.Empty;
                        string location = string.Empty;
                        string country = string.Empty;
                        string postal = string.Empty;
                        string phone = string.Empty;
                        string USERemail = string.Empty;
                        string code = string.Empty;
                        string education1 = string.Empty;
                        string education2 = string.Empty;
                        string titlecurrent = string.Empty;
                        string companycurrent = string.Empty;
                        string titlepast1 = string.Empty;
                        string companypast1 = string.Empty;
                        string titlepast2 = string.Empty;
                        string html = string.Empty;
                        string companypast2 = string.Empty;
                        string titlepast3 = string.Empty;
                        string companypast3 = string.Empty;
                        string titlepast4 = string.Empty;
                        string companypast4 = string.Empty;
                        string Recommendations = string.Empty;
                        string Connection = string.Empty;
                        string Designation = string.Empty;
                        string Website = string.Empty;
                        string Contactsettings = string.Empty;
                        string recomandation = string.Empty;

                        string titleCurrenttitle = string.Empty;
                        string titleCurrenttitle2 = string.Empty;
                        string titleCurrenttitle3 = string.Empty;
                        string titleCurrenttitle4 = string.Empty;
                        string Skill = string.Empty;
                        string TypeOfProfile = "Public1";

                        string Finaldata = string.Empty;
                        #endregion

                        #region LDS_DataInitialization
                        string LDS_FirstName = string.Empty;
                        string LDS_LastName = string.Empty;
                        string LDS_UserProfileLink = string.Empty;
                        string LDS_HeadLineTitle = string.Empty;
                        string LDS_CurrentTitle = string.Empty;
                        string LDS_PastTitles = string.Empty;
                        string LDS_Loction = string.Empty;
                        string LDS_Country = string.Empty;
                        string LDS_Connection = string.Empty;
                        string LDS_Recommendations = string.Empty;
                        string LDS_SkillAndExpertise = string.Empty;
                        string LDS_Education = string.Empty;
                        string LDS_Experience = string.Empty;
                        string LDS_ProfileType = "Public";
                        string LDS_Groups = string.Empty;
                        string LDS_UserEmail = string.Empty;
                        string LDS_UserContactNumber = string.Empty;
                        string LDS_CurrentCompany = string.Empty;
                        string LDS_PastCompany = string.Empty;
                        string LDS_LoginID = string.Empty;
                        string LDS_Websites = string.Empty;
                        string LDS_Industry = string.Empty;
                        #endregion

                        #region Chilkat Initialization

                        Chilkat.Http http = new Chilkat.Http();

                        ///Chilkat Http Request to be used in Http Post...
                        Chilkat.HttpRequest req = new Chilkat.HttpRequest();
                        Chilkat.HtmlUtil htmlUtil = new Chilkat.HtmlUtil();

                        // Any string unlocks the component for the 1st 30-days.
                        bool success = http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06");
                        if (success != true)
                        {
                            Console.WriteLine(http.LastErrorText);
                            return;
                        }

                        http.CookieDir = "memory";
                        http.SendCookies = true;
                        http.SaveCookies = true;

                        html = HttpHelper.getHtmlfromUrl1(new Uri(Url));

                        html = htmlUtil.EntityDecode(html);
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:ClsScrapGroupMember.cs

示例10: PostFinalMsgGroupMember_1By1

        public void PostFinalMsgGroupMember_1By1(ref GlobusHttpHelper HttpHelper, Dictionary<string, string> SlectedContacts,List<string> GrpMemSubjectlist,List<string> GrpMemMessagelist, string msg, string body, string UserName, string FromemailId, string FromEmailNam, string SelectedGrpName, string grpId,bool mesg_with_tag,bool msg_spintaxt, int mindelay, int maxdelay,bool preventMsgSameGroup,bool preventMsgWithoutGroup,bool preventMsgGlobal)
        {
            try
             {
                 MsgGroupMemDbManager objMsgGroupMemDbMgr = new MsgGroupMemDbManager();

                 string postdata = string.Empty;
                 string postUrl = string.Empty;
                 string ResLogin = string.Empty;
                 string csrfToken = string.Empty;
                 string sourceAlias = string.Empty;
                 string ReturnString = string.Empty;
                 string PostMsgSubject = string.Empty;
                 string PostMsgBody = string.Empty;
                 string FString = string.Empty;

                 try
                 {
                     string MessageText = string.Empty;
                     string PostedMessage = string.Empty;
                     string senderEmail = string.Empty;
                     string getComposeData = HttpHelper.getHtmlfromUrl(new Uri("https://www.linkedin.com/inbox/compose"));
                     try
                     {
                         int startindex = getComposeData.IndexOf("\"senderEmail\" value=\"");
                         if (startindex < 0)
                         {
                             startindex = getComposeData.IndexOf("\"senderEmail\",\"value\":\"");
                         }
                         string start = getComposeData.Substring(startindex).Replace("\"senderEmail\" value=\"", string.Empty).Replace("\"senderEmail\",\"value\":\"",string.Empty);
                         int endindex = start.IndexOf("\"/>");
                         if (endindex < 0)
                         {
                             endindex = start.IndexOf("\",\"");
                         }
                         string end = start.Substring(0, endindex).Replace("\"/>", string.Empty).Replace("\",\"",string.Empty);
                         senderEmail = end.Trim();
                     }
                     catch
                     {}
                     string pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));
                     if (pageSource.Contains("csrfToken"))
                     {
                         try
                         {
                             csrfToken = pageSource.Substring(pageSource.IndexOf("csrfToken"), 50);
                             string[] Arr = csrfToken.Split('<');
                             csrfToken = Arr[0];
                             csrfToken = csrfToken.Replace("csrfToken", "").Replace("\"", string.Empty).Replace("value", string.Empty).Replace("cs", string.Empty).Replace("id", string.Empty).Replace("=", string.Empty).Replace("\n",string.Empty).Replace(">",string.Empty).Replace("<script typ",string.Empty);
                             csrfToken = csrfToken.Trim();
                         }
                         catch (Exception ex)
                         {

                         }

                     }

                     if (pageSource.Contains("sourceAlias"))
                     {
                         try
                         {
                             sourceAlias = pageSource.Substring(pageSource.IndexOf("sourceAlias"), 100);
                             string[] Arr = sourceAlias.Split('"');
                             sourceAlias = Arr[2];
                         }
                         catch (Exception ex)
                         {

                         }
                     }

                     if (pageSource.Contains("goback="))
                     {
                         try
                         {
                         }
                         catch (Exception ex)
                         {

                         }
                     }

                         foreach (KeyValuePair<string, string> itemChecked in SlectedContacts)
                         {
                             try
                             {
                                 DataSet ds = new DataSet();
                                 DataSet ds_bList = new DataSet();
                                 string ContactName = string.Empty;
                                 string Nstring = string.Empty;
                                 string connId = string.Empty;
                                 string FName = string.Empty;
                                 string Lname = string.Empty;
                                 string tempBody = string.Empty;
                                 string n_ame1 = string.Empty;

                                 //grpId = itemChecked.Key.ToString();

                                 try
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:MessageGroupMember.cs

示例11: GetMultipleRecords

        public void GetMultipleRecords(ref GlobusHttpHelper HttpHelper)
        {
            try
            {
                string csrfToken = string.Empty;
                string LastName = string.Empty;
                string FirstName = string.Empty;
                string Industry = string.Empty;
                string Postalcode = string.Empty;
                string Distance = string.Empty;
                string contentSummary = string.Empty;
                string Title = string.Empty;
                string Company = string.Empty;
                string school = string.Empty;
                string Country = string.Empty;
                string countrycode = string.Empty;
                string industrycode = string.Empty;
                string rsid = string.Empty;

                string pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));

                try
                {
                    try
                    {
                        string[] Arr_Pst = Regex.Split(postalCode, "(");
                    }
                    catch { }
                    try
                    {
                        Postalcode = postalCode.Substring(0, postalCode.IndexOf(" "));
                        Country = postalCode.Replace(Postalcode, string.Empty).Replace(")", string.Empty).Replace("(", string.Empty).Trim();

                    }
                    catch
                    {
                        if (Postalcode == string.Empty)
                        {
                            Postalcode = postalCode;
                        }
                    }
                }
                catch { }
                if (pageSource.Contains("csrfToken"))
                {
                    csrfToken = pageSource.Substring(pageSource.IndexOf("csrfToken"), 100);
                    string[] Arr = csrfToken.Split('&');
                    csrfToken = Arr[0];
                    csrfToken = csrfToken.Replace("csrfToken=", "");
                    csrfToken = csrfToken.Replace("%3A", ":");
                }
                InBoardPro.GetIndustryCode objIndustry = new GetIndustryCode();
                Dictionary<string, string> Dict_IndustryCode = new Dictionary<string, string>();

                Dict_IndustryCode = objIndustry.getIndustry();
                foreach (KeyValuePair<string, string> item in Dict_IndustryCode)
                {
                    try
                    {
                        string toloweritem = item.Value.ToLower();
                        string tolowerindustrytype = industryType.ToLower();
                        if (toloweritem == tolowerindustrytype)
                        {
                            //SearchCriteria.Country = item.Key;
                            industrycode = item.Key;
                            break;
                        }
                    }
                    catch
                    {
                    }
                }

                Dictionary<string, string> Dict_CountryCode = new Dictionary<string, string>();
                Dict_CountryCode = objIndustry.getCountry();
                foreach (KeyValuePair<string, string> item in Dict_CountryCode)
                {
                    try
                    {
                        string toloweritem = item.Value.ToLower();
                        string tolowercountrytype = Country.ToLower();
                        if (toloweritem == tolowercountrytype)
                        {
                            countrycode = item.Key;
                            break;
                        }
                    }
                    catch
                    {
                    }
                }
                string Firstresponse = string.Empty;
                if (string.IsNullOrEmpty(countrycode))
                {
                    countrycode = "us";
                }

                string FirstGetRequestUrl = string.Empty;
                string FirstGetResponse = string.Empty;
                {
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:LinkedinMultipleScrapRecord.cs

示例12: SetProfilePic

        public bool SetProfilePic(ref GlobusHttpHelper HttpHelper, string profileId, string Username, string Password, string localImagePath, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref string status, string UploadInfoData)
        {
            string FirstGetREsponse = string.Empty;
            try
            {
                FirstGetREsponse = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/profile/edit-picture-info?trk=prof-ovw-edit-photo"));
            }
            catch { }
            if (string.IsNullOrEmpty(FirstGetREsponse))
            {
                try
                {
                    FirstGetREsponse = HttpHelper.getHtmlfromUrl(new Uri("https://www.linkedin.com/profile/edit-picture-info?goback=%2Enpv_" + profileId + "_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&trk=prof-ovw-edit-photo"));
                }
                catch { }
            }
            string[] upload_infoArr = Regex.Split(FirstGetREsponse, " name=\"upload_info");
            string upload_infow = string.Empty;
            string upload_infowithjs = string.Empty;
            if (true)
            {
                try
                {
                    upload_infow = upload_infoArr[1].Substring(upload_infoArr[1].IndexOf("value="), upload_infoArr[1].IndexOf(">") - upload_infoArr[1].IndexOf("value=")).Replace("value=", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace("/", string.Empty).Trim();
                }
                catch { }
                try
                {
                    upload_infowithjs = upload_infoArr[2].Substring(upload_infoArr[2].IndexOf("value="), upload_infoArr[2].IndexOf(">") - upload_infoArr[2].IndexOf("value=")).Replace("value=", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace("/", string.Empty).Trim();
                }
                catch { }
            }
            else
            {
                //try
                //{
                //    string[] upload_infoArr1 = Regex.Split(FirstGetREsponse, "id\":\"upload_info");
                //    upload_infow = upload_infoArr1[1].Substring(upload_infoArr1[1].IndexOf("value\":"), upload_infoArr1[1].IndexOf("type") - upload_infoArr1[1].IndexOf("value\":")).Replace("value\":", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace(",", string.Empty).Trim();
                //}
                //catch { }
            }
            string posturi = string.Empty;
            if (FirstGetREsponse.Contains("name=\"uploadMemberPicture"))
            {
                try
                {
                    string[] MemberPicture = Regex.Split(FirstGetREsponse, "name=\"uploadMemberPicture");
                    posturi = MemberPicture[1].Substring(MemberPicture[1].IndexOf("action="), MemberPicture[1].IndexOf("method=") - MemberPicture[1].IndexOf("action=")).Replace("action=", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Replace("/", string.Empty).Trim();
                }
                catch { }
            }

            bool isSetProfilePic = false;
            try
            {

                string upload_info = "";
                upload_info = upload_infow;

                string upload_info_with_js = "";
                upload_info_with_js = upload_infowithjs;

                //upload_info = upload_info.Replace("&dsh;", "-"); ;
                //upload_info_with_js = upload_info;

                string callback = "";
                callback = "profilePicture.processResponse";
                NameValueCollection nvc = new NameValueCollection();

                nvc.Add("upload_info", upload_info_with_js);
                nvc.Add("upload_info_with_js", upload_info_with_js);
                nvc.Add("callback", callback);
                //nvc.Add("Content-Type:", "image/jpeg");
                posturi = posturi.Replace("mupld", string.Empty);
                //string response = HttpHelper.HttpUploadProfilePic(ref HttpHelper, profileId, "http://www.linkedin.com/mupld/" + posturi, "pic", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                string response = string.Empty;
                try
                {
                    response = HttpHelper.HttpUploadProfilePic(ref HttpHelper, profileId, "http://www.linkedin.com/mupld/upload", "pic", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                }
                catch { }
                if (string.IsNullOrEmpty(response))
                {
                    response = HttpHelper.HttpUploadProfilePic(ref HttpHelper, profileId, "https://www.linkedin.com/mupld/upload?goback=%2Enpv_" + profileId + "_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1", "pic", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(proxyPort), proxyUsername, proxyPassword);
                    //http://www.linkedin.com/mupld/process?filter=car450&return_type=html&mid=%2Fp/6/005/025/1b7/34bf4a0.jpg&callback=profilePicture.savePhoto&filters_scale_h=397&filters_scale_w=600&filters_crop_x=101&filters_crop_y=0&filters_crop_h=396.99966&filters_crop_w=396.99966&filters_rotate_t=
                }
                string Images1 = string.Empty;
                if (response.Contains("SUCCESS"))
                {
                    try
                    {
                        Images1 = response.Substring(response.IndexOf("value\":"), response.IndexOf("}") - response.IndexOf("value\":")).Replace("value\":", string.Empty).Replace("\"", string.Empty).Replace("\\", string.Empty).Trim();
                        Images1 = Images1.Substring(1, (Images1.Length - 1));
                        Images1 = Images1.Remove(Images1.IndexOf(","));
                        Images1 = "/" + Images1;
                    }
                    catch { }
                }
                string csrfToken = string.Empty;
                string sourceAlias = string.Empty;
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:GlobusHttpHelper.cs

示例13: HttpUploadFile_AddaCover

        public string HttpUploadFile_AddaCover(ref GlobusHttpHelper HttpHelper, string userid, string url, string paramName, string contentType, string localImagePath, NameValueCollection nvc, string proxyAddress, int proxyPort, string proxyUsername, string proxyPassword)
        {

            #region PostData_ForUploadImage
            //-----------------------------68682554727644
            //Content-Disposition: form-data; name="fb_dtsg"

            //AQCLSjCH
            // -----------------------------68682554727644
            //Content-Disposition: form-data; name="pic"; filename="Hydrangeas.jpg"
            //Content-Type: image/jpeg

            //���� 
            #endregion


            bool isAddaCover = false;
            string responseStr = string.Empty;

            try
            {
                ////log.Debug(string.Format("Uploading {0} to {1}", file, url));
                //string boundary = "---------------------------" + DateTime.Now.Ticks.ToString("");
                string boundary = "---------------------------" + DateTime.Now.Ticks.ToString();
                byte[] boundarybytes = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");

                gRequest = (HttpWebRequest)WebRequest.Create(url);
                gRequest.ContentType = "multipart/form-data; boundary=" + boundary;
                gRequest.Referer = "Referer: https://www.facebook.com/profile.php?id=" + userid + "&ref=tn_tnmn";
                gRequest.Method = "POST";
                gRequest.KeepAlive = true;
                gRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;

                ChangeProxy(proxyAddress, proxyPort, proxyUsername, proxyPassword);

                gRequest.CookieContainer = new CookieContainer(); //gCookiesContainer;

                #region CookieManagment

                if (this.gCookies != null && this.gCookies.Count > 0)
                {
                    gRequest.CookieContainer.Add(gCookies);
                }
                #endregion

                Stream rs = gRequest.GetRequestStream();

                int tempi = 0;

                string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
                foreach (string key in nvc.Keys)
                {
                    string formitem = string.Empty;
                    if (tempi == 0)
                    {
                        byte[] firstboundarybytes = System.Text.Encoding.ASCII.GetBytes("--" + boundary + "\r\n");
                        rs.Write(firstboundarybytes, 0, firstboundarybytes.Length);
                        formitem = string.Format(formdataTemplate, key, nvc[key]);
                        byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
                        rs.Write(formitembytes, 0, formitembytes.Length);
                        tempi++;
                        continue;
                    }
                    //rs.Write(boundarybytes, 0, boundarybytes.Length);
                    //formitem = string.Format(formdataTemplate, key, nvc[key]);
                    //byte[] formitembytes = System.Text.Encoding.UTF8.GetBytes(formitem);
                    //rs.Write(formitembytes, 0, formitembytes.Length);
                }
                rs.Write(boundarybytes, 0, boundarybytes.Length);

                string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";
                string header = string.Format(headerTemplate, paramName, localImagePath, contentType);
                byte[] headerbytes = System.Text.Encoding.UTF8.GetBytes(header);
                rs.Write(headerbytes, 0, headerbytes.Length);

                FileStream fileStream = new FileStream(localImagePath, FileMode.Open, FileAccess.Read);
                byte[] buffer = new byte[4096];
                int bytesRead = 0;
                while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
                {
                    rs.Write(buffer, 0, bytesRead);
                }
                fileStream.Close();

                byte[] trailer3 = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
                rs.Write(trailer3, 0, trailer3.Length);

                string trailerTemplate1 = "Content-Disposition: form-data; name=\"profile_id\"\r\n\r\n{0}\r\n";
                string trailer1 = string.Format(trailerTemplate1, userid);
                byte[] arrtrailer1 = System.Text.Encoding.UTF8.GetBytes(trailer1);
                rs.Write(arrtrailer1, 0, arrtrailer1.Length);

                byte[] trailer4 = System.Text.Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");
                rs.Write(trailer4, 0, trailer3.Length);

                string trailerTemplate2 = "Content-Disposition: form-data; name=\"source\"\r\n\r\n{0}\r\n";
                string trailer2 = string.Format(trailerTemplate2, "10");
                byte[] arrtrailer2 = System.Text.Encoding.UTF8.GetBytes(trailer2);
                rs.Write(arrtrailer2, 0, arrtrailer2.Length);

//.........这里部分代码省略.........
开发者ID:sumitglobussoft,项目名称:Instagram-PVA-BOT,代码行数:101,代码来源:GlobusHttpHelper.cs

示例14: GetAllFriends

        public static List<string> GetAllFriends(ref GlobusHttpHelper globusHttpHelper, string userId)
        {
            List<string> finalList_Friends = new List<string>();

            List<string> list_finalFriendsID = new List<string>();

            try
            {
                string pgSource_Friends = globusHttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/profile.php?id=" + userId + "&sk=friends"));////fbProfileUrl = "https://www.facebook.com/profile.php?id=";

                string[] Friends = Regex.Split(pgSource_Friends, "user.php");

                ParseFriendIDs(Friends, finalList_Friends);

                List<string> lstnewfriendid = new List<string>();

                // {"collection_token":"1220529617:2356318349:2","cursor":"MDpub3Rfc3RydWN0dXJlZDoxMDAwMDA5MjM1MTg5MjY=","tab_key":"friends","profile_id":1220529617,"overview":false,"ftid":null,"order":null,"sk":"friends"}


                string collection_token = "";
                string cursor = "";

                //check if all friends loaded
                string patternAllFriendsLoaded = "\"TimelineAppCollection\",\"setFullyLoaded\",[],[\"pagelet_timeline_app_collection_";

                int tempCount_AjaxRequests = 0;

                do //
                {
                    try
                    {
                        collection_token = "";
                        cursor = "";

                        string[] arry = Regex.Split(pgSource_Friends, "enableContentLoader");
                        if (arry.Length > 1)
                        {
                            try
                            {
                                string rawData = arry[1];

                                int startIndx_collection_token = rawData.IndexOf("pagelet_timeline_app_collection_") + "pagelet_timeline_app_collection_".Length;
                                int endIndx_collection_token = rawData.IndexOf("\"", startIndx_collection_token);
                                collection_token = rawData.Substring(startIndx_collection_token, endIndx_collection_token - startIndx_collection_token);

                                int startIndx_cursor = rawData.IndexOf(",\"", endIndx_collection_token) + ",\"".Length;
                                int endIndx_cursor = rawData.IndexOf("\"", startIndx_cursor);
                                cursor = rawData.Substring(startIndx_cursor, endIndx_cursor - startIndx_cursor);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                        }

                        string raw_data = "{\"collection_token\":\"" + collection_token + "\",\"cursor\":\"" + cursor + "\",\"tab_key\":\"friends\",\"profile_id\":" + userId + ",\"overview\":false,\"ftid\":null,\"order\":null,\"sk\":\"friends\"}";
                        string encoded_raw_data = Uri.EscapeDataString(raw_data);

                        string getURL_MoreFriendsAjax = "https://www.facebook.com/ajax/pagelet/generic.php/AllFriendsAppCollectionPagelet?data=" + encoded_raw_data + "&__user=" + userId + "&__a=1&__dyn=7n8ahyj2qmudwNAEU&__req=2";
                        string res_getURL_MoreFriendsAjax = globusHttpHelper.getHtmlfromUrl(new Uri(getURL_MoreFriendsAjax));

                        pgSource_Friends = res_getURL_MoreFriendsAjax;

                        string[] arry_UserData = Regex.Split(pgSource_Friends, "user.php");

                        ParseFriendIDs(arry_UserData, finalList_Friends);                       

                        tempCount_AjaxRequests++;
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                } while ((collection_token != "" && cursor != "") || tempCount_AjaxRequests < 15 || pgSource_Friends.Contains(patternAllFriendsLoaded));



                finalList_Friends.ForEach(delegate(String friendID)
                {
                    if (friendID.Contains("&"))
                    {
                        friendID = friendID.Remove(friendID.IndexOf("&"));

                    }
                  
                    list_finalFriendsID.Add(friendID);
                });

                list_finalFriendsID = list_finalFriendsID.Distinct().ToList();
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }

            return list_finalFriendsID;
        }
开发者ID:shah8701,项目名称:faceboard,代码行数:99,代码来源:FBUtils.cs

示例15: CrawlingLinkedInPage

        public bool CrawlingLinkedInPage(string Url, ref GlobusHttpHelper HttpHelper,string FileName)
        {
            //Url = "http://www.linkedin.com/profile/view?id=44952194&authType=OUT_OF_NETWORK&authToken=DYBR&locale=en_US&srchid=3817933251416230963594&srchindex=2&srchtotal=1949&trk=vsrp_people_res_name&trkInfo=VSRPsearchId%3A3817933251416230963594%2CVSRPtargetId%3A44952194%2CVSRPcmpt%3Aprimary";

            #region Data Initialization
            string GroupMemId = string.Empty;
            string Industry = string.Empty;
            string URLprofile = string.Empty;
            string firstname = string.Empty;
            string lastname = string.Empty;
            string location = string.Empty;
            string country = string.Empty;
            string postal = string.Empty;
            string phone = string.Empty;
            string USERemail = string.Empty;
            string code = string.Empty;
            string education1 = string.Empty;
            string education2 = string.Empty;
            string titlecurrent = string.Empty;
            string companycurrent = string.Empty;
            string CurrentCompUrl = string.Empty;
            string CurrentCompSite = string.Empty;
            string titlepast1 = string.Empty;
            string companypast1 = string.Empty;
            string titlepast2 = string.Empty;
            string html = string.Empty;
            string companypast2 = string.Empty;
            string titlepast3 = string.Empty;
            string companypast3 = string.Empty;
            string titlepast4 = string.Empty;
            string companypast4 = string.Empty;
            string Recommendations = string.Empty;
            string Connection = string.Empty;
            string Designation = string.Empty;
            string Website = string.Empty;
            string Contactsettings = string.Empty;
            string recomandation = string.Empty;

            string titleCurrenttitle = string.Empty;
            string titleCurrenttitle2 = string.Empty;
            string titleCurrenttitle3 = string.Empty;
            string titleCurrenttitle4 = string.Empty;
            string Skill = string.Empty;
            string TypeOfProfile = "Public";
            List<string> EducationList = new List<string>();
            string Finaldata = string.Empty;
            string EducationCollection = string.Empty;
            List<string> checkerlst = new List<string>();
            List<string> checkgrplist = new List<string>();
            string groupscollectin = string.Empty;
            string strFamilyName = string.Empty;
            string LDS_LoginID = string.Empty;
            string LDS_Websites = string.Empty;
            string LDS_UserProfileLink = string.Empty;
            string LDS_CurrentTitle = string.Empty;
            string LDS_Experience = string.Empty;
            string LDS_UserContact = string.Empty;
            string LDS_PastTitles = string.Empty;
            string LDS_BackGround_Summary = string.Empty;
            string LDS_Desc_AllComp = string.Empty;
            string Company = string.Empty;
            List<string> lstpasttitle = new List<string>();
            List<string> checkpasttitle = new List<string>();
            string DeegreeConn = string.Empty;
            string AccountType = string.Empty;
            bool CheckEmployeeScraper = false;
            string fileName = string.Empty;
            bool CampaignScraper = false;
            #endregion

            #region GetRequest
            if (Url.Contains("CompanyEmployeeScraper"))
            {
                try
                {
                    Url = Url.Replace("CompanyEmployeeScraper", string.Empty);
                    CheckEmployeeScraper = true;
                }
                catch
                { }
            }

            if (Url.Contains("CampaignScraper"))
            {
                try
                {
                    string[] Url_Split = Regex.Split(Url, "CampaignScraper");
                    Url = Url_Split[0];
                    fileName = Url_Split[1];
                    CampaignScraper = true;
                }
                catch
                { }
            }

            string stringSource = HttpHelper.getHtmlfromUrl(new Uri(Url.Replace("http", "https")));
            #endregion

            #region GroupMemId
            try
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:frmCampaignScraper.cs


注:本文中的BaseLib.GlobusHttpHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。