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.ExecuteAsyncobject(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() });                }

TAG标签: 微信小程序微信生成二维码

http://www.xiaochengxub.com/read-105664.html