string access_token2 = WxPayConfig.GetConfig().IsExistAccess_Token();
RestClient client = new RestClient(“https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=” + access_token2);
RestRequest request = new RestRequest("", HttpMethod.POST);
request.RequestFormat = RequestDataFormat.Json;
request.AddBody(new { scene = lid.Value.ToString("N"), });
var response = client.ExecuteAsync<object>(request);
byte[] tt = response.Result.RawBytes;
if (tt.Length > 1000)
{
if (System.IO.Directory.Exists(HttpContext.Current.Server.MapPath(path)) == false)//如果不存在就创建file文件夹
{
System.IO.Directory.CreateDirectory(HttpContext.Current.Server.MapPath(path));
}
System.IO.File.WriteAllBytes(HttpContext.Current.Server.MapPath(siteFullPath), tt);//讲byte[]存储为图片
}
else
{
LoginRecordDAL.Instance.AddLoginRecord(new loginRecord { msg = "getshare异常数据", userId = Guid.NewGuid() });
}