Пример #1
0
        public bool MultiPartImageUpload(ref GlobusHttpHelper httpHelper, string Username, string Password, string localImagePath, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword)
        {
            /////Login to FB

            ////string valueLSD = "name=" + "\"lsd\"";

            int intProxyPort = 80;

            Regex IdCheck = new Regex("^[0-9]*$");

            if (!string.IsNullOrEmpty(proxyPort) && IdCheck.IsMatch(proxyPort))
            {
                intProxyPort = int.Parse(proxyPort);
            }
            //string pageSource = string.Empty;
            //try
            //{
            //    pageSource = getHtmlfromUrlProxy(new Uri("https://www.facebook.com/login.php"), proxyAddress, intProxyPort, proxyUsername, proxyPassword);
            //    //int startIndex = pageSource.IndexOf(valueLSD) + 18;
            //}
            //catch { }
            //string value = GlobusHttpHelper.GetParamValue(pageSource, "lsd");
            string ResponseLogin = string.Empty;
            try
            {
            //    ResponseLogin = postFormData(new Uri("https://www.facebook.com/login.php?login_attempt=1"), "charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "&locale=en_US&email=" + Username.Split('@')[0] + "%40" + Username.Split('@')[1] + "&pass="******"&persistent=1&default_persistent=1&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&lsd=" + value + "");

                ResponseLogin = httpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com"));
            }
            catch { }
            ///Setting Post Data Params...

            string userId = GlobusHttpHelper.Get_UserID(ResponseLogin);

            if (string.IsNullOrEmpty(userId) || userId == "0" || userId.Length < 3)
            {
                //GlobusLogHelper.log.Info("Please Check The Account : " + Username);
                //GlobusLogHelper.log.Debug("Please Check The Account : " + Username);

                return false;
            }

            string pgSrc_Profile = string.Empty;
            try
            {
                pgSrc_Profile = httpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/profile.php?id=" + userId + ""));
            }
            catch { }
            string profileSource = string.Empty;
            try
            {
                profileSource = httpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/ajax/timeline/profile_pic_selector.php?profile_id=" + userId + "&__a=1&__user="******""));
            }
            catch { }


            //GlobusHttpHelper httpHelper = new GlobusHttpHelper();
            /////Get User ID
            //ProfileIDExtractor idExtracter = new ProfileIDExtractor();
            //idExtracter.ExtractFriendIDs(ref httpHelper, ref userId);


            string fb_dtsg = GlobusHttpHelper.GetParamValue(ResponseLogin, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
            if (string.IsNullOrEmpty(fb_dtsg))
            {
                fb_dtsg = GlobusHttpHelper.ParseJson(ResponseLogin, "fb_dtsg");
            }


            string last_action_id = GlobusHttpHelper.ParseJson(pgSrc_Profile, "last_action_id");

            if (!Utils.IsNumeric(last_action_id))
            {
                last_action_id = "0";
            }

            string postData = "last_action_id=" + last_action_id + "&fb_dtsg=" + fb_dtsg + "&__user="******"&phstamp=165816810252768712174";
            string res = string.Empty;
            try
            {
                res = httpHelper.postFormData(new Uri("https://www.facebook.com/ajax/mercury/thread_sync.php?__a=1"), postData);
            }
            catch { }
            NameValueCollection nvc = new NameValueCollection();
            //nvc.Add("post_form_id", post_form_id);
            nvc.Add("fb_dtsg", fb_dtsg);
            nvc.Add("id", userId);
            nvc.Add("type", "profile");
            //nvc.Add("return", "/ajax/profile/picture/upload_iframe.php?pic_type=1&id=" + userId);
            nvc.Add("return", "/ajax/timeline/profile_pic_upload.php?pic_type=1&id=" + userId);

            //UploadFilesToRemoteUrl("http://upload.facebook.com/pic_upload.php ", new string[] { @"C:\Users\Globus-n2\Desktop\Windows Photo Viewer Wallpaper.jpg" }, "", nvc);
            //HttpUploadFile("http://upload.facebook.com/pic_upload.php ", localImagePath, "file", "image/jpeg", nvc);
            if (HttpUploadFile("https://upload.facebook.com/pic_upload.php ", localImagePath, "pic", "image/jpeg", nvc, proxyAddress, intProxyPort, proxyUsername, proxyPassword))
            //if (HttpUploadFile("http://upload.facebook.com/pic_upload.php ", localImagePath, "file", "image/jpeg", nvc, proxyAddress, intProxyPort, proxyUsername, proxyPassword))
            {
                return true;
            }
            return false;

        }
Пример #2
0
        public bool AddaCover(ref GlobusHttpHelper HttpHelper, string Username, string Password, string localImagePath, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref string status)
        {
            bool isAddaCover = false;
            string fb_dtsg = string.Empty;
            string photo_id = string.Empty;
            string UsreId = string.Empty;

            try
            {

                string pageSource_Home = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/home.php"));

                UsreId = GlobusHttpHelper.GetParamValue(pageSource_Home, "user");
                if (string.IsNullOrEmpty(UsreId))
                {
                    UsreId = GlobusHttpHelper.ParseJson(pageSource_Home, "user");
                }

                fb_dtsg = GlobusHttpHelper.GetParamValue(pageSource_Home, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
                if (string.IsNullOrEmpty(fb_dtsg))
                {
                    fb_dtsg = GlobusHttpHelper.ParseJson(pageSource_Home, "fb_dtsg");
                }

                NameValueCollection nvc = new NameValueCollection();

                nvc.Add("fb_dtsg", fb_dtsg);
                //nvc.Add("filename=", fb_dtsg);
                nvc.Add("Content-Type:", "image/jpeg");

                string response = HttpUploadFile_AddaCover(ref HttpHelper, UsreId, "https://upload.facebook.com/ajax/timeline/cover/upload/", "pic", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                try
                {
               
                    string okay = HttpHelper.getHtmlfromUrl(new Uri("https://3-pct.channel.facebook.com/pull?channel=p" + UsreId + "&seq=3&partition=69&clientid=70e140db&cb=8p7w&idle=8&state=active&mode=stream&format=json"));
                }
                catch (Exception ex)
                {
                    //GlobusLogHelper.log.Error(ex.StackTrace);
                }

                if (!string.IsNullOrEmpty(response) && response.Contains("photo.php?fbid="))
                {
                    #region PostData_ForCoverPhotoSelect
                    //fb_dtsg=AQCLSjCH&photo_id=130869487061841&profile_id=100004163701035&photo_offset=0&video_id=&save=Save%20Changes&nctr[_mod]=pagelet_main_column_personal&__user=100004163701035&__a=1&phstamp=165816776831066772182 
                    #endregion
                    try
                    {
                        string photo_idValue = response.Substring(response.IndexOf("photo.php?fbid="), response.IndexOf(";", response.IndexOf("photo.php?fbid=")) - response.IndexOf("photo.php?fbid=")).Replace("photo.php?fbid=", string.Empty).Trim();
                        string[] arrphoto_idValue = Regex.Split(photo_idValue, "[^0-9]");

                        foreach (string item in arrphoto_idValue)
                        {
                            try
                            {
                                if (item.Length > 6)
                                {
                                    photo_id = item;
                                    break;
                                }
                            }
                            catch (Exception ex)
                            {
                                //GlobusLogHelper.log.Error(ex.StackTrace);
                            }
                        }

                        string postData = "fb_dtsg=" + fb_dtsg + "&photo_id=" + photo_id + "&profile_id=" + UsreId + "&photo_offset=0&video_id=&save=Save%20Changes&nctr[_mod]=pagelet_main_column_personal&__user="******"&__a=1&phstamp=165816776831066772182 ";
                        string postResponse = HttpHelper.postFormData(new Uri("https://www.facebook.com/ajax/timeline/cover_photo_select.php"), postData);

                        if (!postResponse.Contains("error"))
                        {
                            //string ok = "ok";
                            isAddaCover = true;
                        }
                        if (string.IsNullOrEmpty(postResponse) || string.IsNullOrWhiteSpace(postResponse))
                        {
                            status = "Response Is Null !";
                        }
                        if (postResponse.Contains("errorSummary"))
                        {
                            string summary = GlobusHttpHelper.ParseJson(postResponse, "errorSummary");
                            string errorDescription = GlobusHttpHelper.ParseJson(postResponse, "errorDescription");

                            status = "Posting Error: " + summary + " | Error Description: " + errorDescription;
                            //FanPagePosterLogger("Posting Error: " + summary + " | Error Description: " + errorDescription);
                        }
                    }
                    catch (Exception ex)
                    {
                        //GlobusLogHelper.log.Error(ex.StackTrace);
                    }
                }
                else
                {
                    if (response.Contains("Please choose an image that"))
                    {
                        status = "Please choose an image that's at least 399 pixels wide";
                    }

                }
            }
            catch (Exception ex)
            {
                //GlobusLogHelper.log.Error(ex.StackTrace);
            }
            return isAddaCover;
        }
Пример #3
0
       public bool AddaPicture2(ref GlobusHttpHelper HttpHelper, string Username, string Password, List<string> localImagePath, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, string targeturl, string message, ref string status, string pageSource_Home, string xhpc_targetid, string xhpc_composerid, string message_text, string fb_dtsg, string UsreId, string pageSource, ref int tempCountMain)
       {
           {

               pageSource = HttpHelper.getHtmlfromUrl(new Uri(targeturl));
               int tempCount = 0;
           startAgain:

               bool isSentPicMessage = false;
               //string fb_dtsg = string.Empty;
               string photo_id = string.Empty;
               //string UsreId = string.Empty;
               //xhpc_composerid = string.Empty;
               //xhpc_targetid = string.Empty;
               //message_text = string.Empty;

               try
               {
                   #region commentedCode


                   //string pageSource_Home = HttpHelper.getHtmlfromUrl(new Uri("http://www.facebook.com/home.php"));

                   //UsreId = GlobusHttpHelper.GetParamValue(pageSource_Home, "user");
                   //if (string.IsNullOrEmpty(UsreId))
                   //{
                   //    UsreId = GlobusHttpHelper.ParseJson(pageSource_Home, "user");
                   //}

                   //fb_dtsg = GlobusHttpHelper.GetParamValue(pageSource_Home, "fb_dtsg");//pageSourceHome.Substring(pageSourceHome.IndexOf("fb_dtsg") + 16, 8);
                   //if (string.IsNullOrEmpty(fb_dtsg))
                   //{
                   //    fb_dtsg = GlobusHttpHelper.ParseJson(pageSource_Home, "fb_dtsg");
                   //}


                   //string pageSource_HomeData = HttpHelper.getHtmlfromUrl(new Uri(targeturl));
                   //xhpc_composerid = GlobusHttpHelper.GetParamValue(pageSource_HomeData, "composerid");
                   //xhpc_targetid = GlobusHttpHelper.GetParamValue(pageSource_HomeData, "xhpc_targetid"); 
                   #endregion

                   NameValueCollection newnvcTEMP = new NameValueCollection();

                   string composer_session_id = "";

                   string tempresponse1 = "";
                   ///temp post
                   {
                       string source = "";
                       string profile_id = "";
                       string gridID = "";
                       //  string qn = string.Empty;

                       try
                       {
                           string Url = "https://www.facebook.com/ajax/composerx/attachment/media/upload/?composerurihash=1";
                           string posturl1 = "fb_dtsg=" + fb_dtsg + "&composerid=" + xhpc_composerid + "&targetid=" + xhpc_targetid + "&loaded_components[0]=maininput&loaded_components[1]=cameraicon&loaded_components[2]=withtaggericon&loaded_components[3]=placetaggericon&loaded_components[4]=mainprivacywidget&loaded_components[5]=cameraicon&loaded_components[6]=mainprivacywidget&loaded_components[7]=withtaggericon&loaded_components[8]=placetaggericon&loaded_components[9]=maininput&nctr[_mod]=pagelet_group_composer&__user="******"&__a=1&__dyn=7n88QoAMNoBwXAw&__req=i&phstamp=16581688688747595501";    //"fb_dtsg=" + fb_dtsg + "&composerid=" + xhpc_composerid + "&targetid=" + xhpc_targetid + "&istimeline=1&timelinelocation=composer&loaded_components[0]=maininput&loaded_components[1]=mainprivacywidget&loaded_components[2]=mainprivacywidget&loaded_components[3]=maininput&loaded_components[4]=explicitplaceinput&loaded_components[5]=hiddenplaceinput&loaded_components[6]=placenameinput&loaded_components[7]=hiddensessionid&loaded_components[8]=withtagger&loaded_components[9]=backdatepicker&loaded_components[10]=placetagger&loaded_components[11]=withtaggericon&loaded_components[12]=backdateicon&loaded_components[13]=citysharericon&nctr[_mod]=pagelet_timeline_recent&__user="******"&__a=1&__dyn=7n88QoAMNoBwXAw&__req=18&phstamp=1658168111112559866679";
                           // string PostUrl = "city_id=" + CityIDS1 + "&city_page_id=" + city_page_id + "&city_name=" + CityName1 + "&is_default=false&session_id=1362404125&__user="******"&__a=1&__dyn=798aD5z5ynU&__req=z&fb_dtsg=" + fb_dtsg + "&phstamp=1658168111112559866165";
                           string res11 = HttpHelper.postFormData(new Uri(Url), posturl1);


                           try
                           {
                               source = res11.Substring(res11.IndexOf("source\":"), (res11.IndexOf(",", res11.IndexOf("source\":")) - res11.IndexOf("source\":"))).Replace("source\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                           }
                           catch { }
                           try
                           {
                               profile_id = res11.Substring(res11.IndexOf("profile_id\":"), (res11.IndexOf("}", res11.IndexOf("profile_id\":")) - res11.IndexOf("profile_id\":"))).Replace("profile_id\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                               if (profile_id.Contains(","))
                               {
                                   profile_id = ParseEncodedJson(res11, "profile_id");
                               }
                               //"gridID":
                           }
                           catch { }
                           try
                           {
                               gridID = res11.Substring(res11.IndexOf("gridID\":"), (res11.IndexOf(",", res11.IndexOf("gridID\":")) - res11.IndexOf("gridID\":"))).Replace("gridID\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                           }
                           catch { }
                           try
                           {
                               composer_session_id = res11.Substring(res11.IndexOf("composer_session_id\":"), (res11.IndexOf("}", res11.IndexOf("composer_session_id\":")) - res11.IndexOf("composer_session_id\":"))).Replace("composer_session_id\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                           }
                           catch { }

                           try
                           {
                               if (string.IsNullOrEmpty(composer_session_id))
                               {
                                   composer_session_id = res11.Substring(res11.IndexOf("composerID\":"), (res11.IndexOf("}", res11.IndexOf("composerID\":")) - res11.IndexOf("composerID\":"))).Replace("composerID\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();

                               }
                           }
                           catch { }

                           try
                           {
                               qn = getBetween(res11, "qn\\\" value=\\\"", "\\\" \\/>");
                           }
                           catch { }
                       }
                       catch { }

                       NameValueCollection nvc1 = new NameValueCollection();
                       try
                       {
                           //message = Uri.EscapeDataString(message);
                       }
                       catch { }

                       //xhpc_composerid = GlobusHttpHelper.GetParamValue(pageSource_HomeData, "composerid");
                       //xhpc_targetid = GlobusHttpHelper.GetParamValue(pageSource_HomeData, "xhpc_targetid");
                       //-------------------------------
                       //nvc1.Add("fb_dtsg", fb_dtsg);
                       //nvc1.Add("source", source);
                       //nvc1.Add("profile_id", profile_id);
                       //nvc1.Add("grid_id", gridID);
                       //nvc1.Add("upload_id", "1024");
                       //-----------------------------------
                       nvc1.Add("fb_dtsg", fb_dtsg);
                       nvc1.Add("source", source);
                       nvc1.Add("profile_id", profile_id);
                       nvc1.Add("grid_id", gridID);
                       nvc1.Add("upload_id", "1024");
                       nvc1.Add("qn", qn);

                       //nvc1.Add("fb_dtsg", fb_dtsg);
                       //nvc1.Add("source", source);
                       //nvc1.Add("profile_id", profile_id);
                       //nvc1.Add("grid_id", gridID);
                       //nvc1.Add("upload_id", "1024");
                       //nvc1.Add("qn", qn);

                       string _rev = getBetween(pageSource, "svn_rev", ",");
                       _rev = _rev.Replace("\":", string.Empty);


                       string uploadURL = "https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished?target_id=" + xhpc_targetid + "&__user="******"&__a=1&__dyn=7n88Oq9ccmqDxl2u5Fa8HzCqm5Aqbx2mbAKGiBAGm&__req=1t&fb_dtsg=" + fb_dtsg + "&__rev=" + _rev + "";
                      // string uploadURL = "https://upload.facebook.com/media/upload/photos/composer/?__user=100004602582421&__a=1&__dyn=7n88Oq9caRCFUSt2u5KIGKaExEW9J6yUgByVbGAEGGG&__req=12&fb_dtsg=AQDEsnKQ&ttstamp=2658168691151107581&__rev=1089685&";

                       //foreach (var item in collection)
                       //{

                       //}

                       foreach (string image in localImagePath)
                       {
                           tempresponse1 = HttpUploadFile_UploadPic_temp(ref HttpHelper, UsreId, uploadURL, "composer_unpublished_photo[]", "image/jpeg", image, nvc1, "", proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                           if (tempresponse1.ToLower().Contains("errorsummary") && tempresponse1.ToLower().Contains("There was a problem with this request. We're working on getting it fixed as soon as we can".ToLower()))
                           {
                               if (tempCount < 2)
                               {
                                   System.Threading.Thread.Sleep(15000);
                                   tempCount++;
                                   goto startAgain;
                               }
                               else
                               {
                                   tempCountMain++;
                                   return false;
                               }
                           }

                           //string response = HttpUploadFile_UploadPic(ref HttpHelper, UsreId, "https://upload.facebook.com/ajax/timeline/cover/upload/", "pic", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                           //string response = HttpUploadFile_UploadPic(ref HttpHelper, UsreId, "http://upload.facebook.com/media/upload/photos/composer/?__a=1&__adt=3&__iframe=true&__user="******"file1", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                           //tempresponse1 = HttpUploadFile_UploadPic_temp(ref HttpHelper, UsreId, "https://upload.facebook.com/ajax/composerx/attachment/media/saveunpublished?target_id=" + xhpc_targetid + "&__user="******"&__a=1&__dyn=7n88QoAMNoBwXAw&__req=l&fb_dtsg=" + fb_dtsg + "", "composer_unpublished_photo[]", "image/jpeg", localImagePath, nvc1, "", proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                           //composer_unpublished_photo
                           string composer_unpublished_photo = "";
                           string start_composer_unpublished_photo = Regex.Split(tempresponse1, "},\"")[1];// 

                           int startIndex_composer_unpublished_photo = start_composer_unpublished_photo.IndexOf(",\"") + ",\"".Length;
                           int endIndex_composer_unpublished_photo = start_composer_unpublished_photo.IndexOf("\"", startIndex_composer_unpublished_photo + 1);

                           composer_unpublished_photo = start_composer_unpublished_photo.Substring(startIndex_composer_unpublished_photo, endIndex_composer_unpublished_photo - startIndex_composer_unpublished_photo);



                           if (tempresponse1.Contains("composer_unpublished_photo"))
                           {
                               try
                               {
                                   composer_unpublished_photo = tempresponse1.Substring(tempresponse1.IndexOf("composer_unpublished_photo[]"), tempresponse1.IndexOf("u003Cbutton") - tempresponse1.IndexOf("composer_unpublished_photo[]")).Replace("composer_unpublished_photo[]", "").Replace("value=", "").Replace("\\", "").Replace("\\", "").Replace("/>", "").Replace("\"", "").Trim();
                                   //.Replace("composer_session_id\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                               }
                               catch { }
                           }

                           newnvcTEMP.Add("composer_unpublished_photo[]", composer_unpublished_photo);
                       }
                       
                   }

                   NameValueCollection nvc = new NameValueCollection();
                   try
                   {
                       //message = Uri.EscapeDataString(message);
                   }
                   catch { }
                   nvc.Add("fb_dtsg", fb_dtsg);
                   nvc.Add("xhpc_targetid", xhpc_targetid);
                   nvc.Add("xhpc_context", "profile");
                   nvc.Add("xhpc_ismeta", "1");
                   nvc.Add("xhpc_fbx", "1");
                   nvc.Add("xhpc_timeline", "");
                   nvc.Add("xhpc_composerid", xhpc_composerid);
                   nvc.Add("xhpc_message_text", message);
                   nvc.Add("xhpc_message", message);
                   //nvc.Add("name", "file1");
                   //nvc.Add("Content-Type:", "image/jpeg");
                   //nvc.Add("filename=", "");


                   ////composer_unpublished_photo
                   //string composer_unpublished_photo = "";
                   //string start_composer_unpublished_photo = Regex.Split(tempresponse1, "},\"")[1];// 



                   //int startIndex_composer_unpublished_photo = start_composer_unpublished_photo.IndexOf(",\"") + ",\"".Length;
                   //int endIndex_composer_unpublished_photo = start_composer_unpublished_photo.IndexOf("\"", startIndex_composer_unpublished_photo + 1);

                   //composer_unpublished_photo = start_composer_unpublished_photo.Substring(startIndex_composer_unpublished_photo, endIndex_composer_unpublished_photo - startIndex_composer_unpublished_photo);

               
                   
                   //if (tempresponse1.Contains("composer_unpublished_photo"))
                   //{
                   //    try
                   //    {
                   //        composer_unpublished_photo = tempresponse1.Substring(tempresponse1.IndexOf("composer_unpublished_photo[]"), tempresponse1.IndexOf("u003Cbutton") - tempresponse1.IndexOf("composer_unpublished_photo[]")).Replace("composer_unpublished_photo[]", "").Replace("value=", "").Replace("\\", "").Replace("\\", "").Replace("/>", "").Replace("\"", "").Trim();
                   //        //.Replace("composer_session_id\":", string.Empty).Replace("<dd>", string.Empty).Replace("\\", string.Empty).Replace("\"", string.Empty).Trim();
                   //    }
                   //    catch { }
                   //}
                   ///New test upload pic post
                   ///
               
                



                   string waterfallid = GlobusHttpHelper.ParseJson(pageSource_Home, "waterfallID");

                   if (waterfallid.Contains("ar"))
                   {
                       waterfallid = qn;
                   }



                   string newpostURL = "https://upload.facebook.com/media/upload/photos/composer/?__user="******"&__a=1&__dyn=7n88QoAMNoBwXAw&__req=r&fb_dtsg=" + fb_dtsg + "";
                   string newPostData = "";


                   NameValueCollection newnvc = new NameValueCollection();
                   try
                   {
                       //message = Uri.EscapeDataString(message);
                   }
                   catch { }
                   newnvc.Add("fb_dtsg", fb_dtsg);
                   newnvc.Add("xhpc_targetid", xhpc_targetid);
                   newnvc.Add("xhpc_context", "profile");
                   newnvc.Add("xhpc_ismeta", "1");
                   newnvc.Add("xhpc_fbx", "1");
                   newnvc.Add("xhpc_timeline", "");
                   newnvc.Add("xhpc_composerid", xhpc_composerid);
                   newnvc.Add("xhpc_message_text", message);
                   newnvc.Add("xhpc_message", message);

                   newnvc.Add(newnvcTEMP);
                   //newnvc.Add("composer_unpublished_photo[]", composer_unpublished_photo);
                   newnvc.Add("album_type", "128");
                   newnvc.Add("is_file_form", "1");
                   newnvc.Add("oid", "");
                   newnvc.Add("qn", qn);//newnvc.Add("qn", waterfallid);
                   newnvc.Add("application", "composer");
                   newnvc.Add("is_explicit_place", "");
                   newnvc.Add("composertags_place", "");
                   newnvc.Add("composertags_place_name", "");
                   newnvc.Add("composer_session_id", composer_session_id);
                   newnvc.Add("composertags_city", "");
                   newnvc.Add("vzdisable_location_sharing", "false");
                   newnvc.Add("composer_predicted_city", "");



                   //string response = HttpUploadFile_UploadPic(ref HttpHelper, UsreId, newpostURL, "file1", "image/jpeg", localImagePath, newnvc, targeturl, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);//HttpUploadFile_UploadPic(ref HttpHelper, UsreId, "http://upload.facebook.com/media/upload/photos/composer/?__user="******"&__a=1&__dyn=7n88O49ccm9o-2Ki&__req=1c&fb_dtsg=" + fb_dtsg + "", "file1", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);
                   string response = HttpUploadFile_UploadPic(ref HttpHelper, UsreId, newpostURL, "file1", "image/jpeg", localImagePath, newnvc, targeturl, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);//HttpUploadFile_UploadPic(ref HttpHelper, UsreId, "http://upload.facebook.com/media/upload/photos/composer/?__user="******"&__a=1&__dyn=7n88O49ccm9o-2Ki&__req=1c&fb_dtsg=" + fb_dtsg + "", "file1", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                   try
                   {
                       string chek = HttpHelper.getHtmlfromUrl(new Uri("https://www.facebook.com/"));
                   }
                   catch { };
                   //http://upload.facebook.com/media/upload/photos/composer/?__a=1&__adt=3&__iframe=true&__user=100004608395129
                   if (string.IsNullOrEmpty(response))
                   {
                       try
                       {
                           //response = HttpUploadFile_UploadPic(ref HttpHelper, UsreId, "https://upload.facebook.com/media/upload/photos/composer/?__a=1&__adt=3&__iframe=true&__user="******"file1", "image/jpeg", localImagePath, nvc, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);
                           response = HttpUploadFile_UploadPic(ref HttpHelper, UsreId, "https://upload.facebook.com/media/upload/photos/composer/?__user="******"&__a=1&__dyn=7n88O49ccm9o-2Ki&__req=1c&fb_dtsg=" + fb_dtsg + "", "file1", "image/jpeg", localImagePath, nvc, targeturl, proxyAddress, Convert.ToInt32(0), proxyUsername, proxyPassword);

                       }
                       catch { }
                   }
                   string posturl = "https://www.facebook.com/ajax/places/city_sharer_reset.php";
                   string postdata = "__user="******"&__a=1&fb_dtsg=" + fb_dtsg + "&phstamp=1658167761111108210145";
                   string responsestring = HttpHelper.postFormData(new Uri(posturl), postdata);
                   try
                   {
                       string okay = HttpHelper.getHtmlfromUrl(new Uri("https://3-pct.channel.facebook.com/pull?channel=p_" + UsreId + "&seq=3&partition=69&clientid=70e140db&cb=8p7w&idle=8&state=active&mode=stream&format=json"));
                   }
                   catch
                   {
                   }

                   if (!string.IsNullOrEmpty(response) && response.Contains("payload\":{\"photo_fbid"))//response.Contains("photo.php?fbid="))
                   {

                       #region PostData_ForCoverPhotoSelect
                       //fb_dtsg=AQCLSjCH&photo_id=130869487061841&profile_id=100004163701035&photo_offset=0&video_id=&save=Save%20Changes&nctr[_mod]=pagelet_main_column_personal&__user=100004163701035&__a=1&phstamp=165816776831066772182 
                       #endregion

                       try
                       {

                           if (!response.Contains("errorSummary") || !response.Contains("error"))
                           {
                               isSentPicMessage = true;
                           }
                           if (response.Contains("Your post has been submitted and is pending approval by an admin"))
                           {
                               //GlobusLogHelper.log.Debug("Your post has been submitted and is pending approval by an admin." + "GroupUrl >>>" + targeturl);
                               //GlobusLogHelper.log.Info("Your post has been submitted and is pending approval by an admin." + "GroupUrl >>>" + targeturl);
                           }
                       }
                       catch { }
                       #region CodeCommented
                       //    string photo_idValue = response.Substring(response.IndexOf("photo.php?fbid="), response.IndexOf(";", response.IndexOf("photo.php?fbid=")) - response.IndexOf("photo.php?fbid=")).Replace("photo.php?fbid=", string.Empty).Trim();
                       //    string[] arrphoto_idValue = Regex.Split(photo_idValue, "[^0-9]");

                       //    foreach (string item in arrphoto_idValue)
                       //    {
                       //        try
                       //        {
                       //            if (item.Length > 6)
                       //            {
                       //                photo_id = item;
                       //                break;
                       //            }
                       //        }
                       //        catch
                       //        {
                       //        }
                       //    }

                       //   // string postData = "fb_dtsg=" + fb_dtsg + "&photo_id=" + photo_id + "&profile_id=" + UsreId + "&photo_offset=0&video_id=&save=Save%20Changes&nctr[_mod]=pagelet_main_column_personal&__user="******"&__a=1&phstamp=165816776831066772182 ";
                       //   // string postResponse = HttpHelper.postFormData(new Uri("https://www.facebook.com/ajax/timeline/cover_photo_select.php"), postData);

                       //    //if (!postResponse.Contains("error"))
                       //    //{
                       //    //    //string ok = "ok";
                       //    //    isSentPicMessage = true;
                       //    //}
                       //    //if (string.IsNullOrEmpty(postResponse) || string.IsNullOrWhiteSpace(postResponse))
                       //    //{
                       //    //    status = "Response Is Null !";
                       //    //}
                       //    //if (postResponse.Contains("errorSummary"))
                       //    //{
                       //    //    string summary = GlobusHttpHelper.ParseJson(postResponse, "errorSummary");
                       //    //    string errorDescription = GlobusHttpHelper.ParseJson(postResponse, "errorDescription");

                       //    //    status = "Posting Error: " + summary + " | Error Description: " + errorDescription;
                       //    //    //FanPagePosterLogger("Posting Error: " + summary + " | Error Description: " + errorDescription);
                       //    //}
                       //}
                       //catch
                       //{
                       //} 
                       #endregion
                   }
               }
               catch
               {
               }
               return isSentPicMessage;
           }

       }