var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]); return null;
}
三:C#--后台获取--openid、unionid (创建wx.ashx.cs)
using Common;
using HealthApp.Common.wx;
using Newtonsoft.Json.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Script.Serialization;
namespace HealthApp.Ashx
{
/// <summary>
/// wx 的摘要说明
/// </summary>
public class wx : IHttpHandler
{
public static string AppID = "";//公众号APPID
public static string AppSecret = "";//公众号AppSecret