GetHtmlAsync() public static method

public static GetHtmlAsync ( string url ) : Task
url string
return Task
Beispiel #1
0
        public async Task <UserInfoModel> GetMyUserInfo()
        {
            if (IsLogin())
            {
                try
                {
                    string url = string.Format("http://account.bilibili.com/api/myinfo?access_key={0}&appkey={1}&platform=wp&type=json", BiliApiHelper.access_key, BiliApiHelper._appKey_IOS);
                    url += "&sign=" + BiliApiHelper.GetSign(url);
                    string results = await BiliInterface.GetHtmlAsync(url);

                    UserInfoModel model = JsonConvert.DeserializeObject <UserInfoModel>(results);
                    //AttentionList = model.attentions;
                    return(model);
                }
                catch (Exception)
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }