CSharpTradeOffers.Community.CommunityHandler.SetProfile C# (CSharp) Метод

SetProfile() публичный Метод

Sets the user's public profile settings to the exact settings specified in the Profile object.
public SetProfile ( Profile profile, Account account ) : bool
profile Profile The object to specify the new profile data.
account CSharpTradeOffers.Web.Account The account of the profile to modify.
Результат bool
        public bool SetProfile(Profile profile, Account account)
        {
            string url = "https://steamcommunity.com/profiles/" + account.SteamId + "/edit";

            string sessionid =
                (from Cookie cookie in _account.AuthContainer.GetCookies(new Uri("https://steamcommunity.com"))
                 where cookie.Name == "sessionid"
                 select cookie.Value).FirstOrDefault();

            var data = new Dictionary<string, string>
            {
                {"sessionID", sessionid},
                {"type", Profile.Type},
                {"weblink_1_title", profile.Weblink1Title},
                {"weblink_1_url", profile.Weblink1Url},
                {"weblink_2_title", profile.Weblink2Title},
                {"weblink_2_url", profile.Weblink2Url},
                {"weblink_3_title", profile.Weblink3Title},
                {"weblink_3_url", profile.Weblink3Url},
                {"personaName", profile.PersonaName},
                {"real_name", profile.RealName},
                {"country", profile.Country},
                {"state", profile.State},
                {"city", profile.City},
                {"customURL", profile.CustomUrl},
                {"summary", profile.Summary},
                {"favorite_badge_badgeid", profile.FavoriteBadgeBadgeId.ToString()},
                {"favorite_badge_communityitemid", profile.FavoriteBadgeCommunityItemId.ToString()},
                {"primary_group_steamid", profile.PrimaryGroupSteamId.ToString()}
            };

            string response = _web.Fetch(url, "POST", data, _account.AuthContainer).ReadStream();
            return response.Contains("<div class=\"saved_changes_msg\">");
        }