当前位置:   article > 正文

c#生成微信小程序二维码

c#生成微信小程序二维码

1.后端代码
[HttpPost]
public byte[] getTgyQRCodeAsync2([FromBody] dynamic Json)
{
string token = GetAccessToken2();

        var scene = Json.accout.ToString();
        var page = "pages/myIndex/clinicSign/clinicSign";

        var url = string.Format("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token={0}", token);

        var postData = new
        {
            scene,
            page,
      
        }.ToJson();
        System.Net.HttpWebRequest request;
        request = (System.Net.HttpWebRequest)WebRequest.Create(url);
        request.Method = "POST";
        request.ContentType = "application/json;charset=UTF-8";
        byte[] payload;
        payload = System.Text.Encoding.UTF8.GetBytes(postData);
        request.ContentLength = payload.Length;
        Stream writer = request.GetRequestStream();
        writer.Write(payload, 0, payload.Le
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/寸_铁/article/detail/942361
推荐阅读
相关标签
  

闽ICP备14008679号