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


C# GlobusHttpHelper.postFormDataRef方法代码示例

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


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

示例1: AddSpecificGroupUser


//.........这里部分代码省略.........
                    {

                        string txid = (UnixTimestampFromDateTime(System.DateTime.Now) * 1000).ToString();

                        if (counter == 1)
                        {
                            pageSource = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/groups?viewMembers=&gid=" + gid.Split(':')[2]));
                            RgxSikValue = System.Text.RegularExpressions.Regex.Split(pageSource, "sik");
                            try
                            {
                                sikvalue = RgxSikValue[1].Split('&')[0].Replace("=", string.Empty);
                            }
                            catch { }

                            try
                            {
                                if (NumberHelper.ValidateNumber(sikvalue))
                                {
                                    sikvalue = sikvalue.Split('\"')[0];
                                }
                                else
                                {
                                    sikvalue = sikvalue.Split('\"')[0];
                                }
                            }
                            catch
                            {
                                sikvalue = sikvalue.Split('\"')[0];
                            }

                            if (!string.IsNullOrEmpty(sikvalue))
                            {
                                string postdata = "csrfToken=" + csrfToken + "&searchField=" + SearchKeyword + "&searchMembers=submit&searchMembers=Search&gid=" + gid.Split(':')[2] + "&goback=.gna_" + gid.Split(':')[2] + "";
                                pageSource = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/groups"), postdata, "http://www.linkedin.com/groups?viewMembers=&gid=" + gid.Split(':')[2] + "&sik=" + txid + "&split_page=" + i + "&goback=%2Egna_" + gid.Split(':')[2] + "", "", "");

                            }
                            else
                            {
                                pageSource = HttpHelper.getHtmlfromUrl(new Uri("https://www.linkedin.com/grp/members?csrfToken="+csrfToken+"&search="+SearchKeyword.Replace(" ","+")+"&gid=" + gid.Split(':')[2]));
                            }
                        }

                        if (!string.IsNullOrEmpty(sikvalue))
                        {
                            if (counter > 1)
                            {

                                string getdata = "http://www.linkedin.com/groups?viewMembers=&gid=" + gid.Split(':')[2] + "&sik=" + txid + "&split_page=" + i + "&goback=%2Egna_" + gid.Split(':')[2] + "";
                                pageSource = HttpHelper.getHtmlfromUrl(new Uri(getdata));
                            }

                            RgxGroupData = System.Text.RegularExpressions.Regex.Split(pageSource, "<li class=\"member\" id=\"");

                            if (counter == 1)
                            {
                                try
                                {
                                    RgxPageNo = System.Text.RegularExpressions.Regex.Split(pageSource, "<h3 class=\"page-title\">Search Results: <span>");
                                    pageno = Convert.ToInt32(RgxPageNo[1].Split('<')[0].Replace("(", string.Empty).Replace(")", string.Empty).Replace("+", string.Empty).Trim());
                                    pageno = pageno / 20 + 1;
                                }
                                catch { }

                                if (pageno > 25)
                                {
                                    pageno = 25;
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:GroupStatus.cs

示例2: UpdateStatusUsingAllurl

        public void UpdateStatusUsingAllurl(ref GlobusHttpHelper HttpHelper, int mindelay, int maxdelay)
        {
            try
            {
                string csrfToken = string.Empty;
                string sourceAlias = string.Empty;
                string ImgCount = string.Empty;
                string LogoUrl = string.Empty;
                string mentioned = string.Empty;
                string EntityId = string.Empty;
                string contentTitle = string.Empty;
                string contentSummary = string.Empty;
                string progressId = string.Empty;

                string pageSource = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/home?trk=hb_tab_home_top"));
                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", ":");
                }
                if (pageSource.Contains("sourceAlias"))
                {
                    sourceAlias = pageSource.Substring(pageSource.IndexOf("sourceAlias"), 100);
                    string[] ArrsourceAlias = sourceAlias.Split('"');
                    sourceAlias = ArrsourceAlias[2];
                }

                if (pageSource.Contains("X-Progress-ID"))
                {
                    progressId = pageSource.Substring(pageSource.IndexOf("X-Progress-ID"), 100);
                    string[] ArrsprogressId = progressId.Split('"');
                    progressId = ArrsprogressId[0].Replace("X-Progress-ID=", string.Empty).Replace("=",string.Empty);
                }
                string aaa = "lite/web-action-track?csrfToken=" + csrfToken +"";
                string post = HttpHelper.postFormData(new Uri("http://www.linkedin.com/"),aaa);

                string post1 = "X-Progress-ID=" + progressId + "&iframe_jsonp=true&window_post=true&post_window=parent&jsonp_callback=SlideshareUploader"+progressId;
                string pageSource1 = HttpHelper.postFormDataRef(new Uri("http://slideshare.www.linkedin.com/upload?"), post1, "http://www.linkedin.com/", csrfToken,"");
               // string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/nhome/uscp-poll?queryAfter=1387628141050&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&orderBy=Time&showHidden=false&realTimeTest=C"));
                try
                {
                    mentioned = "%5B%5D";
                }
                catch { }

                try
                {

                    string ReqUrl = Post;
                    //ReqUrl = ReqUrl.Replace(":", "%3A").Replace("//", "%2F%2F");
                   // string pageSource1 = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/nhome/uscp-poll?queryAfter=1387606658969&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&orderBy=Time&showHidden=false&realTimeTest=C"));
                    csrfToken = csrfToken.Replace(":","%3A");
                    string postUrlData = " https://www.linkedin.com/lite/web-action-track?csrfToken=" + csrfToken;
                    string postData = "pkey=member-home&tcode=hp-shr-actvt-msg&plist=";
                    string ResponseStatusMsg1 = HttpHelper.postFormData(new Uri(postUrlData), postData);
                    string pageSource11 = "";
                    //string GetStatus = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/share?getPreview=&url=" + ReqUrl));
                    //string GetStatus = HttpHelper.getHtmlfromUrl(new Uri("http://www.linkedin.com/nhome/uscp-poll?queryAfter=1387606658969&goback=%2Enmp_*1_*1_*1_*1_*1_*1_*1_*1_*1_*1&orderBy=Time&showHidden=false&realTimeTest=C"));
                   /* try
                    {
                        int StartinImgCnt = GetStatus.IndexOf("current");
                        string startImgCnt = GetStatus.Substring(StartinImgCnt);
                        int EndIndexImgCnt = startImgCnt.IndexOf("</span>");
                        string EndImgCnt = startImgCnt.Substring(0, EndIndexImgCnt).Replace("value\":", "").Replace("\"", "");
                        ImgCount = EndImgCnt.Replace("current", string.Empty).Replace(">", string.Empty);
                    }
                    catch
                    {
                        ImgCount = "0";
                    }

                    try
                    {
                        int StartinImgUrl = GetStatus.IndexOf("url");
                        string startImgUrl = GetStatus.Substring(StartinImgUrl);
                        int EndIndexImgUrl = startImgUrl.IndexOf("\"");
                        string EndImgUrl = startImgUrl.Substring(0, EndIndexImgUrl).Replace("value\":", "").Replace("\"", "");
                        LogoUrl = EndImgUrl.Replace("url=", string.Empty).Trim();
                    }
                    catch
                    {
                        LogoUrl = "false";
                    }

                    try
                    {
                        int StartinEntityId = GetStatus.IndexOf("data-entity-id");
                        string startEntityId = GetStatus.Substring(StartinEntityId);
                        int EndIndexEntityId = startEntityId.IndexOf("data-entity-url");
                        string EndEntityId = startEntityId.Substring(0, EndIndexEntityId).Replace("value\":", "").Replace("\"", "");
                        EntityId = EndEntityId.Replace("\"", string.Empty).Replace("data-entity-id", string.Empty).Replace("=", string.Empty).Trim();
                    }
                    catch { }

                    try
                    {
                        int StartinContent = GetStatus.IndexOf("share-view-title");
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:StatusUpdate.cs

示例3: StartCreateGroup

        public void StartCreateGroup(ref GlobusHttpHelper HttpHelper, int mindelay, int maxdelay)
        {
            try
            {
                 string UploadInfo = string.Empty;
                string status = string.Empty;
                string TempID = string.Empty;
                string image = string.Empty;
                string PostCreateGroup = string.Empty;
                string ResponseStatusMsg = string.Empty;
                string urlForNewGroupCreated = string.Empty;
                Log("[ " + DateTime.Now + " ] => [ Group Creation In Account :" + accountUser + " ]");
                try
                {
                    string PageSource1 = string.Empty;
                      for (int i = 0; i <= 5;i++)
                      {
                          PageSource1 = HttpHelper.getHtmlfromUrl1(new Uri("http://www.linkedin.com/createGroup?displayCreate=&trk=anet_creategrp"));
                          if (!string.IsNullOrEmpty(PageSource1))
                          {
                              break;
                          }
                          Thread.Sleep(2 * 1000);
                      }

                    if (PageSource1.Contains("Confirm Your Email Address:"))
                    {
                        //
                        GlobusFileHelper.AppendStringToTextfileNewLine(accountUser + ":" + accountPass + ":" + proxyAddress + ":" + proxyPort + ":" + proxyUserName + ":" + proxyPassword, Globals.path_NotCreateGroup);
                        Log("[ " + DateTime.Now + " ] => [ Cannot Create Group , Confirm Your Email Address for Create group you must have at least one confirmed email address: " + accountUser + " ]");
                        return;
                    }

                    csrfToken = GetCsrfToken(PageSource1);
                    try
                    {
                        int StartIndex = PageSource1.IndexOf("name=\"upload_info\"");
                        string start = PageSource1.Substring(StartIndex).Replace("name=\"upload_info\"", "").Replace("type=\"hidden\"", "").Replace("value=\"", "");
                        int EndIndex = start.IndexOf("\"/>");
                        string end = start.Substring(0, EndIndex).Replace("value=\"", "").Replace(" ", "");
                        UploadInfo = end;
                    }
                    catch (Exception ex)
                    {

                    }

                    NameValueCollection nvc = new NameValueCollection();
                    nvc.Add("csrfToken", csrfToken);
                    nvc.Add("upload_info", UploadInfo);
                    nvc.Add("callback", "logo.processResponseLargeLogo");
                    nvc.Add("isCSMode", "false");
                    nvc.Add("_method", "PUT");

                    string[] array = Regex.Split(PostIamge, ".");
                    if (!string.IsNullOrEmpty(PostIamge))
                    {
                        Log("[ " + DateTime.Now + " ] => [ Uploading Logo ]");
                    }
                    image = array[array.Length - 1];
                    string result = HttpHelper.HttpUploadFileBackground("http://www.linkedin.com/mupld/upload", PostIamge, "file", "image/" + image, nvc, true, ref status);
                    if (result.Contains("{\"status\":\"ERROR\""))
                    {
                        Log("[ " + DateTime.Now + " ] => [ Error In Uploading Logo ! ]");
                        return;
                    }
                    try
                    {
                        int Startindex = result.IndexOf("value\":");
                        string start = result.Substring(Startindex);
                        int EndIndex = start.IndexOf("\",");
                        string End = start.Substring(0, EndIndex).Replace("value\":", "").Replace("\"", "");
                        TempID = End;
                    }
                    catch (Exception ex)
                    {

                    }
                    string CSVHeader = "UserName" + "," + "GroupName" + "," +"CreatedGroupUrl";
                    string GetRequest = HttpHelper.getHtmlfromUrl1(new Uri("http://media03.linkedin.com/media/" + TempID));
                    TempID = Uri.EscapeDataString(TempID.Replace("\\", ""));

                    if (SearchCriteria.CreateGroupStatus == "Member")
                    {
                        Log("[ " + DateTime.Now + " ] => [ Creating Member Group ]");
                        PostCreateGroup = "csrfToken=" + Uri.EscapeDataString(csrfToken) + "&acceptLogoTerms=acceptLogoTerms&groupName=" + PostGrpName + "&groupCategory=" + SearchCriteria.GroupType + "&otherGroupCategory=&shortDesc=" + PostGrpSummry + "&longDesc=" + PostGrpDesc + "&homeSite=" + PostGrpWebsite + "&groupEmail=" + Uri.EscapeDataString(accountUser) + "&groupInDirectory-open=groupInDirectory-open&logoInProfiles-open=logoInProfiles-open&membersSendInvites-open=membersSendInvites-open&access=request&groupInDirectory-request=groupInDirectory-request&logoInProfiles-request=logoInProfiles-request&emailDomains=&language=" + SearchCriteria.GroupLang + "&countryCode=&postalCode=&acceptContract=acceptContract&create=Create+a+Members-Only+Group&gid=&largeLogoTempID=" + TempID + "&discVisibility=false&tetherAccountID=&facebookTetherID=&uncroppedHeroImageID=&croppedHeroImageID=&heroImageCropParams=";
                        ResponseStatusMsg = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/createGroup"), PostCreateGroup, "http://www.linkedin.com/createGroup", "", "");

                        Thread.Sleep(2000);

                        if (ResponseStatusMsg.Contains("Please choose a different group name.") || ResponseStatusMsg.Contains("Sorry this group name is not available. Please choose a different one."))
                        {
                            PostGrpName = PostGrpName + "New";
                            string CSV_Content = accountUser + "," + PostGrpName;
                            PostCreateGroup = "csrfToken=" + Uri.EscapeDataString(csrfToken) + "&acceptLogoTerms=acceptLogoTerms&groupName=" + PostGrpName + "&groupCategory=" + SearchCriteria.GroupType + "&otherGroupCategory=&shortDesc=" + PostGrpSummry + "&longDesc=" + PostGrpDesc + "&homeSite=" + PostGrpWebsite + "&groupEmail=" + Uri.EscapeDataString(accountUser) + "&groupInDirectory-open=groupInDirectory-open&logoInProfiles-open=logoInProfiles-open&membersSendInvites-open=membersSendInvites-open&access=request&groupInDirectory-request=groupInDirectory-request&logoInProfiles-request=logoInProfiles-request&emailDomains=&language=" + SearchCriteria.GroupLang + "&countryCode=&postalCode=&acceptContract=acceptContract&create=Create+a+Members-Only+Group&gid=&largeLogoTempID=" + TempID + "&discVisibility=false&tetherAccountID=&facebookTetherID=&uncroppedHeroImageID=&croppedHeroImageID=&heroImageCropParams=";
                            ResponseStatusMsg = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/createGroup"), PostCreateGroup, "http://www.linkedin.com/createGroup", "", "");
                            Thread.Sleep(2000);
                            if (ResponseStatusMsg.Contains("Send Invitation"))
                            {
                                Log("[ " + DateTime.Now + " ] => [ New Member-Only-Group Create : " + PostGrpName + " Place of " + PostGrpName + " has Successfully Created on: " + accountUser + " ]");
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:CreateGroup.cs

示例4: AddSpecificGroupUserWithExcelInput


//.........这里部分代码省略.........
                            try
                            {
                                RgxSikValue = System.Text.RegularExpressions.Regex.Split(pageSource, "sik");
                            }
                            catch { }

                            try
                            {
                                sikvalue = RgxSikValue[1].Split('&')[0].Replace("=", string.Empty);
                            }
                            catch { }

                            try
                            {
                                if (NumberHelper.ValidateNumber(sikvalue))
                                {
                                    sikvalue = sikvalue.Split('\"')[0];
                                }
                                else
                                {
                                    sikvalue = sikvalue.Split('\"')[0];
                                }
                            }
                            catch
                            {
                                sikvalue = sikvalue.Split('\"')[0];
                            }

                            string postdata = "csrfToken=" + csrfToken + "&searchField=" + Uri.EscapeDataString(mem) + "&searchMembers=submit&searchMembers=Search&gid=" + gid + "&goback=.gna_" + gid + "";

                            #region Commented old code
                            try
                            {
                                pageSource = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/groups"), postdata, "http://www.linkedin.com/groups?viewMembers=&gid=" + gid + "&sik=" + sikvalue + "&split_page=1&goback=%2Egna_" + gid + "", "", "");
                            }
                            catch { }

                            if (pageSource.Contains("Sorry, we found 0 members matching your search."))
                            {
                                Loggergrppmem("[ " + DateTime.Now + " ] => [ Sorry, we found 0 members matching your search : " + mem + " ]");
                                continue;
                            }

                            if (counter > 1)
                            {
                                RgxSikValue = System.Text.RegularExpressions.Regex.Split(pageSource, "sik");
                                try
                                {
                                    sikvalue = RgxSikValue[1].Split('&')[0].Replace("=", string.Empty);
                                }
                                catch { }

                                try
                                {
                                    if (NumberHelper.ValidateNumber(sikvalue))
                                    {
                                        sikvalue = sikvalue.Split('\"')[0];
                                    }
                                    else
                                    {
                                        sikvalue = sikvalue.Split('\"')[0];
                                    }
                                }
                                catch
                                {
                                    sikvalue = sikvalue.Split('\"')[0];
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:GroupStatus.cs

示例5: 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;
//.........这里部分代码省略.........
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:LinkedinLogin.cs

示例6: PostFinalMsg


//.........这里部分代码省略.........

                                 if (preventMsgGlobalUser)
                                 {
                                     try
                                     {
                                         string Querystring = "Select MsgFrom,MsgToId,MsgTo,MsgSubject,MsgBody From tb_ManageComposeMsg Where MsgToId = " + connId + "";
                                         ds = DataBaseHandler.SelectQuery(Querystring, "tb_ManageComposeMsg");
                                     }
                                     catch { }
                                 }

                                 try
                                 {
                                     string PostMessage = string.Empty;
                                     string ResponseStatusMsg = string.Empty;

                                     Log("[ " + DateTime.Now + " ] => [ Message Sending Process Running.. ]");

                                     if (ds.Tables.Count > 0)
                                     {
                                         if (ds.Tables[0].Rows.Count > 0)
                                         {

                                             PostMessage = "";
                                             ResponseStatusMsg = "Already Sent";

                                         }
                                         else
                                         {

                                             PostMessage = "senderEmail=" + FromemailId.Trim() + "&ccInput=&subject=" + Uri.EscapeDataString(msg.ToString()) + "&body=" + Uri.EscapeDataString(body.ToString()) + "&isReply=&isForward=&itemId=&recipients=" + Uri.EscapeUriString(connId) + "&recipientNames=" + Uri.EscapeUriString(Nstring) + "&groupId=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "&submit=Send+Message";
                                             //ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/inbox/mailbox/message/send"), PostMessage);

                                             ResponseStatusMsg = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/inbox/mailbox/message/send"), PostMessage, "https://www.linkedin.com/inbox/", "", "", "XMLHttpRequest", "https://www.linkedin.com","1");   //ahmed sudi client changes
                                         }
                                     }
                                     else
                                     {

                                         PostMessage = "senderEmail=" + FromemailId.Trim() + "&ccInput=&subject=" + Uri.EscapeDataString(msg.ToString()) + "&body=" + Uri.EscapeDataString(body.ToString()) + "&isReply=&isForward=&itemId=&recipients=" + Uri.EscapeUriString(connId) + "&recipientNames=" + Uri.EscapeUriString(Nstring) + "&groupId=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias + "&submit=Send+Message";
                                         //ResponseStatusMsg = HttpHelper.postFormData(new Uri("http://www.linkedin.com/inbox/mailbox/message/send"), PostMessage);
                                         ResponseStatusMsg = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/inbox/mailbox/message/send"), PostMessage, "https://www.linkedin.com/inbox/", "", "", "XMLHttpRequest", "https://www.linkedin.com", "1");   //ahmed sudi client changes
                                     }

                                     if (ResponseStatusMsg.Contains("Your message was successfully sent.") || ResponseStatusMsg.Contains("Tu mensaje ha sido enviado con éxito."))
                                     {
                                         foreach (var item in SlectedSentContacts)
                                         {
                                             try
                                             {
                                                 string Querystring = "Select ProfileID From tb_BlackListAccount Where ProfileID ='" + item.Key + "'";
                                                 ds_bList = DataBaseHandler.SelectQuery(Querystring, "tb_BlackListAccount");
                                             }
                                             catch { }

                                             if (ds_bList.Tables.Count > 0 && ds_bList.Tables[0].Rows.Count > 0)
                                             {

                                                 Log("[ " + DateTime.Now + " ] => [ User: " + item.Value.Replace(":", string.Empty).Trim() + " is Added BlackListed List For Send Messages Pls Check ]");
                                             }
                                             else
                                             {
                                                 Log("[ " + DateTime.Now + " ] => [ Subject Posted : " + msg + " ]");
                                                 Log("[ " + DateTime.Now + " ] => [ Body Text Posted : " + body.ToString() + " ]");
                                                 Log("[ " + DateTime.Now + " ] => [ Message Posted To Account: " + item.Value + " With Username >>> " + UserEmail + " ]");
开发者ID:brentscheidt,项目名称:inboard,代码行数:66,代码来源:ComposeMessage.cs

示例7: AddExperience


//.........这里部分代码省略.........
            if (FirstGetResponse.Contains("csrfToken"))
            {
                try
                {
                    csrfToken = FirstGetResponse.Substring(FirstGetResponse.IndexOf("csrfToken"), 100);
                    string[] Arr = csrfToken.Split('>');
                    csrfToken = Arr[0].Replace("csrfToken=", "").Replace("\"","").Trim();
                }
                catch (Exception ex)
                {
                }
            }

            try
            {
                string[] ArrForValue = Regex.Split(FirstGetResponse, "name\":\"sourceAlias");
                string strValue = (ArrForValue[1].Substring(ArrForValue[1].IndexOf("value\":"), ArrForValue[1].IndexOf("type\":", ArrForValue[1].IndexOf("value\":")) - ArrForValue[1].IndexOf("value\":")).Replace("value\":", string.Empty).Replace("\\\"", string.Empty).Replace("\"", string.Empty).Replace(",","").Trim());
                sourceAlias = (strValue);
            }
            catch { }
            if (FirstGetResponse.Contains("goback"))
            {
                try
                {
                    goback = FirstGetResponse.Substring(FirstGetResponse.IndexOf("goback"), 300);
                    string[] Arr = goback.Split(',');
                    goback = Arr[0].Replace("goback=", "").Replace("\n", string.Empty).Replace("\"", string.Empty);
                }
                catch (Exception ex)
                {
                }
            }

            try
            {
                string postdataa = "csrfToken=" + csrfToken + "&goback=" + goback + "&trk=view-topcard&startTask=&futureOffset=";
                //string CheckRes = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/profile/guided-edit-entry-point"), postdataa, "http://www.linkedin.com/profile/edit?trk=tab_pro", "", "XMLHttpRequest", "", "", "1");
                string CheckRes = HttpHelper.postFormDataRef(new Uri("http://www.linkedin.com/profile/guided-edit-entry-point"), postdataa, "http://www.linkedin.com/profile/edit?trk=nav_responsive_sub_nav_edit_profile", "", "XMLHttpRequest", "", "", "1");
                string FirstPostUrlForAddExperience = "http://www.linkedin.com/lite/web-action-track?csrfToken=" + csrfToken;
                string FirstPostDataForAddExperience = "pkey=nprofile_v2_edit_fs&tcode=nprofile-edit-position-submit&plist=activityType%3Aadd";
                string FirstPostResponseForAddExperience = HttpHelper.postFormDataRef(new Uri(FirstPostUrlForAddExperience), FirstPostDataForAddExperience, "http://www.linkedin.com/profile/edit?trk=nav_responsive_sub_nav_edit_profile", "", "XMLHttpRequest", "", "", "1");
            }
            catch { }

            try
            {
                string SecondPostUrlForAddExperience = "http://www.linkedin.com/lite/web-action-track?csrfToken=" + csrfToken;
                string SecondPostDataForAddExperience = "pkey=nprofile_v2_edit_fs&tcode=nprofile-edit-position-submit&plist=activityType%3Aadd";
                SecondPostDataForAddExperience = "pkey=nprofile_v2_edit_fs&tcode=profile-edit-position-form&plist=source%3Aprof-edit-background-add_position-link";
                string SecondPostResponseForAddExperience = HttpHelper.postFormDataRef(new Uri(SecondPostUrlForAddExperience), SecondPostDataForAddExperience, "http://www.linkedin.com/profile/edit?trk=nav_responsive_sub_nav_edit_profile", "", "XMLHttpRequest", "", "", "1");
            }
            catch { }
            string ThirdPostResponseForAddExperience = string.Empty;
            try
            {
                if (!string.IsNullOrEmpty(endDateYear) && !string.IsNullOrEmpty(endDateMonth))
                {

                    string ThirdPostUrlForAddExperience = "http://www.linkedin.com/profile/edit-position-submit?goback=" + goback;
                    string ThirdPostDataForAddExperience = "companyName=" + Companyname + "&companyDisplayName=" + Companyname + "&title=" + Title + "&positionLocationName=" + Location + "&startDateMonth=" + startDateMonth + "&startDateYear=" + startDateYear + "&endDateMonth=" + endDateMonth + "&endDateYear=" + endDateYear + "&updateHeadline=true&updatedHeadline=&summary=" + Description + "&trk-infoParams=&submit=Save&locale=en_US&timestamp=0&useJsonResponse=true&positionID=&experienceId=&defaultLocaleParam=en_US&companyID=0&positionLocation=0&checkboxValue=&sendMailCheckboxValue=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                    ThirdPostResponseForAddExperience = HttpHelper.postFormDataRef(new Uri(ThirdPostUrlForAddExperience), ThirdPostDataForAddExperience, "http://www.linkedin.com/profile/edit?trk=tab_pro", "", "XMLHttpRequest", "", "", "1");

                    Loger("[ " + DateTime.Now + " ] => [ Experience Add to UserName : " + _UserName + " ]");
                    Loger("[ " + DateTime.Now + " ] => [ Company Name : " + Companyname + " Title : " + Title + " Set Using UserName : " + _UserName + " ]");

                    try
                    {

                        string CSVHeader = "User Name" + "," + "Company Name" + "," + "Title" + "," + "Location" + "," + "Description";
                        string CSV_Content = _UserName + "," + Companyname + "," + Title + "," + Location + "," + Description.Replace(",",string.Empty) ;
                        CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LinkedinAddExperience);
                        Loger("[ " + DateTime.Now + " ] => [ Data Saved In CSV File ! ]");

                    }
                    catch { }

                }
                else
                {
                    string ThirdPostUrlForAddExperience = "http://www.linkedin.com/profile/edit-position-submit?goback=" + goback;
                    string ThirdPostDataForAddExperience = "companyName=" + Companyname + "&companyDisplayName=" + Companyname + "&title=" + Title + "&positionLocationName=" + Location + "&startDateMonth=" + startDateMonth + "&startDateYear=" + startDateYear + "&endDateMonth=&endDateYear=&isCurrent=isCurrent&updateHeadline=true&updatedHeadline=" + Title + "&summary=" + Description + "&trk-infoParams=&submit=Save&locale=en_US&timestamp=1360644826453&useJsonResponse=true&positionID=&experienceId=&defaultLocaleParam=en_US&companyID=0&positionLocation=0&checkboxValue=&sendMailCheckboxValue=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                    ThirdPostResponseForAddExperience = HttpHelper.postFormDataRef(new Uri(ThirdPostUrlForAddExperience), ThirdPostDataForAddExperience, "http://www.linkedin.com/profile/edit?trk=tab_pro", "", "XMLHttpRequest", "", "", "1");
                    Loger("[ " + DateTime.Now + " ] => [ Experience Add to UserName : " + _UserName + " ]");
                    Loger("[ " + DateTime.Now + " ] => [ Company Name : " + Companyname + " Title : " + Title + " Set Using UserName : " + _UserName + " ]");

                    try
                    {

                        string CSVHeader = "User Name" + "," + "Company Name" + "," + "Title" + "," + "Location" + "," + "Description" ;
                        string CSV_Content = _UserName + "," + Companyname + "," + Title + "," + Location + "," + Description.Replace(",","");
                        CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_LinkedinAddExperience);
                        Loger("[ " + DateTime.Now + " ] => [ Data Saved In CSV File ! ]");

                    }
                    catch { }

                }
            }
            catch { }
        }
开发者ID:brentscheidt,项目名称:inboard,代码行数:101,代码来源:ProfileManager.cs

示例8: LoginHttpHelper


//.........这里部分代码省略.........
                        string[] Arr = sourceAlias.Split('"');
                        sourceAlias = Arr[2].Replace("\\", string.Empty);
                    }
                    catch { }
                }

                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(_Username) + "&session_password=" + _Password + "&signin=Sign%20In&session_redirect=&loginCsrfParam=" + regCsrfParam + "&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                postdata = "isJsEnabled=true&source_app=&tryCount=&clickedSuggestion=false&session_key=" + Uri.EscapeDataString(_Username) + "&session_password=" + _Password + "&signin=Sign%20In&session_redirect=&trk=hb_signin&loginCsrfParam=" + regCsrfParam + "&fromEmail=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
               // postdata = "isJsEnabled=true&source_app=&session_key=" + Uri.EscapeDataString(_Username) + "&session_password=" + _Password + "&signin=Sign+In&session_redirect=&trk=&loginCsrfParam=7462d247-6d54-47de-8f22-29723ea15f9d&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                try
                {
                    ResLogin = HttpHelper.postFormDataProxy(new Uri(postUrl), postdata,_ProxyAddress,int.Parse(_ProxyPort),_ProxyUsername,_ProxyPassword);//HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "http://www.linkedin.com/uas/login?goback=&trk=hb_signin", "", "");
                }
                catch { }

                //postUrl = "https://www.linkedin.com/uas/login-submit";
                //isJsEnabled=true&source_app=&tryCount=&session_key=gargimishra%40globussoft.com&session_password=globussoft&signin=Sign%20In&session_redirect=&csrfToken=ajax%3A7066152446927176852&sourceAlias=0_7r5yezRXCiA_H0CRD8sf6DhOjTKUNps5xGTqeX8EEoi
               //postdata = "isJsEnabled=true&source_app=&session_key=" + Uri.EscapeDataString(_Username) + "&session_password=" + Uri.EscapeDataString(_Password) + "&signin=Sign%20In&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;
                // postdata = "session_key=" + Uri.EscapeDataString(_Username) + "&session_password=" + Uri.EscapeDataString(_Password) + "&source_app=&trk=guest_home_login&session_redirect=&csrfToken=" + csrfToken + "&sourceAlias=" + sourceAlias;

                //ResLogin = HttpHelper.postFormDataRef(new Uri(postUrl), postdata, "https://www.linkedin.com/uas/login?goback=&trk=hb_signin", "true", "");
                string dts = string.Empty;
                string captchachallengeid = string.Empty;
                string origActionAlias = string.Empty;
                string origSourceAlias = string.Empty;
                string irhf = string.Empty;
                string captchaText = string.Empty;
                string ImageUrl = string.Empty;
                //
                if (ResLogin.Contains("Your LinkedIn account has been temporarily restricted") || ResLogin.Contains("Change your password") || ResLogin.Contains("Please confirm your email address") && !ResLogin.Contains("Sign Out"))
                {
                    SearchCriteria.loginREsponce = ResLogin;
                }
                else if (ResLogin.Contains("Security Verification"))
                {
                    string dataforcapctha = HttpHelper.getHtmlfromUrl1(new Uri("https://www.google.com/recaptcha/api/noscript?k=6LcnacMSAAAAADoIuYvLUHSNLXdgUcq-jjqjBo5n"));
                    if (!string.IsNullOrEmpty(dataforcapctha))
                    {
                        int startindex = dataforcapctha.IndexOf("id=\"recaptcha_challenge_field\"");
                        if (startindex > 0)
                        {
                            string start = dataforcapctha.Substring(startindex).Replace("id=\"recaptcha_challenge_field\"", "");
                            int endindex = start.IndexOf("\">");
                            string end = start.Substring(0, endindex).Replace("value=", "").Replace("\"", "");
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:LinkedInMaster.cs

示例9: EndorsingPeople


//.........这里部分代码省略.........
                }

                try
                {
                    string _UserId = string.Empty;

                    if (lstskilldata.Count > 0)
                    {

                        foreach (KeyValuePair<string, string> item in lstskilldata)
                        {
                            if (count > 4)
                            {
                                return;
                            }
                            if (!UserId.Contains("http"))
                            {
                                _UserId = UserId;
                            }
                            else
                            {
                                _UserId = Utils.getBetween(UserId+"@", "&id=", "@");
                                if (string.IsNullOrEmpty(_UserId))
                                {
                                    _UserId = Utils.getBetween(UserId + "@", "?id=", "@");
                                }
                                //_UserId = UserId.Substring(UserId.IndexOf("&id=")).Replace("&id=", string.Empty);

                            }

                            postdata = "endorsementCount=1&recipientId-0=" + _UserId + "&recipientType-0=member&endorsedItemName-0=" + Uri.EscapeDataString(item.Key) + "&endorsementId-0=&endorserIds-0=";
                            string PostUrl = "http://www.linkedin.com/profile/endorse?csrfToken=" + csrfToken + "&_ed=" + _ed + "&goback=%2Enpv_" + UserId + "_*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_*1_*1_*1_*1_*1_contacts*5contacts*5list*5contact*4name*50_*1";

                            string PostPageSource = HttpHelper.postFormDataRef(new Uri(endorseUrl), postdata, LinkSource, "", "", "", "", "1");

                            if (!PostPageSource.Contains("fail") || !PostPageSource.Contains("failure"))
                            {
                                string[] ArrayPostedData = System.Text.RegularExpressions.Regex.Split(PostPageSource, "}");
                                //ArrayPostedData = ArrayPostedData.Skip(1).ToArray();
                                foreach (string itemdata in ArrayPostedData)
                                {
                                    foreach (KeyValuePair<string, string> item1 in lstskilldata)
                                    {
                                        if (itemdata.Contains(item1.Key))
                                        {
                                            string status = string.Empty;
                                            try
                                            {
                                                //int startindex = itemdata.IndexOf("endorsementStatus\":\"");
                                                int startindex = PostPageSource.IndexOf("status");
                                                if (startindex >= 0)
                                                {
                                                    //string start = itemdata.Substring(startindex).Replace("endorsementStatus\":\"", "");
                                                    //int endIndex = start.IndexOf("\",\"");
                                                    //string end = start.Substring(0, endIndex).Replace("&amp;", "&");
                                                    //status = end;

                                                    string start = PostPageSource.Substring(startindex).Replace("status", "");
                                                    int endIndex = start.IndexOf("}");
                                                    string end = start.Substring(0, endIndex).Replace("\"", string.Empty).Replace(":", string.Empty);
                                                    status = end;

                                                    string CSVHeader = "UserID" + "," + "Skill" + "," + "Status" + "," + "EndorseID";   //New Addedd
                                                    string CSV_Content = Username + "," + item1.Key + "," + status + "," + UserId;       //new adde
                                                    CSVUtilities.ExportDataCSVFile(CSVHeader, CSV_Content, Globals.path_EndorsedPeopleText);
                                                    Log("[ " + DateTime.Now + " ] => [ Status For Skill : " + item1.Key + " ==> " + status + " ]");
开发者ID:brentscheidt,项目名称:inboard,代码行数:67,代码来源:EndorsePeople.cs


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