服务端跟新浪微博交互的时候需要用到UID参数, 但WP的WeiboSDK默认没有提供, 只要增加一个类成员就好了, 序列化json的时候程序会自动处理

 

下载SDK源代码http://weibowp7sdk.codeplex.com/SourceControl/latest#ReadMe.txt

找到文件SDKCmdDefines.cs,  修改 SdkAuth2Res类, 代码如下

 

    [DataContract]
    public class SdkAuth2Res
    {
        [DataMember(Name = "access_token")]
        public string accesssToken { get; set; }

        [DataMember(Name = "refresh_token")]
        public string refleshToken { get; set; }

        [DataMember(Name = "expires_in")]
        public string expriesIn { get; set; }

        [DataMember(Name = "uid")]
        public string uid { get; set; }
    }

就OK了, 使用方法

private void VerifyBack(bool isSucess, SdkAuthError errCode, SdkAuth2Res response)
        {

            if (errCode.errCode == SdkErrCode.SUCCESS)
            {
                if (null != response)
                {
                    settings["AccessToken"] = response.accesssToken;
                    settings["RefleshToken"] = response.refleshToken;
                    settings["sinauid"] = response.uid;
                    settings.Save();
                }

            }