QcloudSharp是腾讯云API的非官方.Net封装。提供Nuget包和DynamicObject用法。简化了API调用。
安装PM> Install-Package QcloudSharp范例usingQcloudSharp;usingNewtonsoft.Json;dynamicclient=newQcloudClient{SecretId="Your_Secret_Id",SecretKey="Your_Secret_Key",Endpoint=Constants.Endpoint.Trade,//Endpoint可被作为DynamicMethods的第一个参数Region=Constants.Region.CAN,//Region可被作为DynamicMethods的第一个或第二个参数};varresultString=client.DescribeUserInfo();//预期返回值{"code":0,"message":"","userInfo":{"name":"compName","isOwner":1,"mailStatus":1,"mail":"112233@qq.com","phone":"13811112222"}}dynamicresult=JsonConvert.DeserializeObject(resultString);try{Console.WriteLine(result.Code);Console.WriteLine(result.userInfo.name); Console.WriteLine(result.notExist);}catch(Exceptionex){Console.WriteLine(ex.message);}点击空白处退出提示
评论