usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Services;usingSystem.Web.Script.Serialization;usingSystem.Web.Script.Services;usingSystem.Runtime.Serialization.Json;usingSystem.Data;usingSystem.Text;usingSystem.IO;usingSystem.Net;usingNewtonsoft.Json;usingNewtonsoft.Json.Linq;///
///api 的摘要说明///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]//若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。
[System.Web.Script.Services.ScriptService]public classapi : System.Web.Services.WebService
{
[WebMethod]public void OpenID(stringcode)
{//临时登录凭证code 获取 session_key 和 openid
string js_code =code;//此处填写自己小程序的appid和secret
string serviceAddress = "https://api.weixin.qq.com/sns/jscode2session?appid=appid&secret=secret&js_code=