.net core 生成可跳转到小程序指定页面的二维码
1、通过appid和secret获取token
2、 生成小程序码的接口C地址:https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token={access_token},生成小程序码图片保存
string tokenUrl = $"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}";
var responseString = new HttpClient().GetStringAsync(tokenUrl).Result;
dynamic jsonstr = JsonConvert.DeserializeObject(responseString);
if (!string.IsNullOrWhiteSpace(jsonstr.access_token.ToString()))
{
//获取token