微信平台接入web页面功能接口

今年因工作需要,通过微信平台接入公司的Wap页面,回忆下,记录内容,方面以后使用。

1.成为开发者后,你才可以使用公众平台的开发功能。需要填写URL和ToKen,接口配置信息。

2.服务器端开发如下接口,等待微信服务器调用。

URL

用来接收微信服务器数据的接口URL,

http://192.168.0.199/weixin/****.ashx(该地址不固定,可以由后台开发者根据实际情况自己拟定,但只支持80端口)

Token

开发者可以任意拟定,已备用作生成签名(该Token会和接口URL中包含的Token进行比对,从而验证安全性)。

请求方式

Get

接收参数:

参数

描述

signature

微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。

timestamp

时间戳

nonce

随机数

echostr

随机字符串

响应微信服务器:

开发者通过检验signature对请求进行校验(下面有校验方式)。若确认此次GET请求来自微信服务器,请原样返回echostr参数内容,则接入生效,否则接入失败。

加密/校验流程如下:

1. 将token、timestamp、nonce三个参数进行字典序排序

2. 将三个参数字符串拼接成一个字符串进行sha1加密

3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信

3. 在公众平台网站的高级功能 – 开发模式页,点击“成为开发者”按钮,填写URL和Token。提交信息后,微信服务器将发送GET请求到填写的URL上,进行接入验证。

4.C#代码

object signature = context.Request.QueryString["signature"];
object timestamp = context.Request.QueryString["timestamp"];
object nonce = context.Request.QueryString["nonce"];
object echoStr = context.Request.QueryString["echoStr"];
if (signature != null && signature.ToString() != "" && timestamp != null && timestamp.ToString() != "" && nonce != null && nonce.ToString() != "" && echoStr != null && echoStr.ToString() != "")
{
CheckSignature(signature.ToString(), timestamp.ToString(), nonce.ToString(), echoStr.ToString(), token);
} /// <summary>
/// 验证微信 字典排序后 返回随机数
/// </summary>
/// 将token、timestamp、nonce三个参数进行字典排序
/// 将三个参数字符串拼接成一个字符串sha1加密
/// 获取加密后的字符串可与signature 对比 如果为true则返回随数
/// <returns></returns>
private void CheckSignature(string signature, string timestamp, string nonce, string echoStr, string Token)
{ string[] ArrTmp = { Token, timestamp, nonce };
Array.Sort(ArrTmp); //首º¡Á先¨¨字Á?典Ì?排?序¨°
string tmpStr = string.Join("", ArrTmp);
tmpStr = FormsAuthentication.HashPasswordForStoringInConfigFile(tmpStr, "SHA1"); //sha1
tmpStr = tmpStr.ToLower();
if (tmpStr == signature)
{
if (!string.IsNullOrEmpty(echoStr))
{
System.Web.HttpContext.Current.Response.Write(echoStr);
System.Web.HttpContext.Current.Response.End();
}
}
}

5.验证通过后,就可以得到appid 和secret参数了

6.创建菜单

(1)目前自定义菜单最多包括3个一级菜单,每个一级菜单最多包含5个二级菜单。一级菜单最多4个汉字,二级菜单最多7个汉字,多出来的部分将会以“...”代替。请注意,创建自定义菜单后,由于微信客户端缓存,需要24小时微信客户端才会展现出来。建议测试时可以尝试取消关注公众账号后再次关注,则可以看到创建后的效果。

目前自定义菜单接口可实现两种类型按钮,如下:

click

用户点击click类型按钮后,微信服务器会通过消息接口推送消息类型为event       的结构给开发者(参考消息接口指南),并且带上按钮中开发者填写的key值,开发者可以通过自定义的key值与用户进行交互;

view

用户点击view类型按钮后,微信客户端将会打开开发者在按钮中填写的url值        (即网页链接),达到打开网页的目的,建议与网页授权获取用户基本信息接口结合,获得用户的登入个人信息。

(2)示例:

接口调用请求说明

http请求方式:POST(请使用https协议)

https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN

请求示例

{
     "button":[
     {   
          "type":"click",
          "name":"今日歌曲",
          "key":"V1001_TODAY_MUSIC"
      },
      {
           "type":"click",
           "name":"歌手简介",
           "key":"V1001_TODAY_SINGER"
      },
      {
           "name":"菜单",
           "sub_button":[
           {     
               "type":"view",
               "name":"搜索",
               "url":"http://www.soso.com/"
            },
            {
               "type":"view",
               "name":"视频",
               "url":"http://v.qq.com/"
            },
            {
               "type":"click",
               "name":"赞一下我们",
               "key":"V1001_GOOD"
            }]
       }]
 }

参数说明

参数

是否必须

说明

button

一级菜单数组,个数应为1~3个

sub_button

二级菜单数组,个数应为1~5个

type

菜单的响应动作类型,目前有click、view两种类型

name

菜单标题,不超过16个字节,子菜单不超过40个字节

key

click类型必须

菜单KEY值,用于消息接口推送,不超过128字节

url

view类型必须

网页链接,用户点击菜单可打开链接,不超过256字节

返回结果

正确时的返回JSON数据包如下:

{"errcode":0,"errmsg":"ok"}

错误时的返回JSON数据包如下(示例为无效菜单名长度):

{"errcode":40018,"errmsg":"invalid
button name size"}

(3)代码

 /// <summary>
///创建菜单
/// </summary>
/// <param name=\"sender\"></param>
/// <param name=\"e\"></param>
protected void btnCreateMenu_Click(object sender, EventArgs e)
{
string postUrl = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}";
postUrl = string.Format(postUrl, GetAccessToken());
string menuInfo = getMenuInfo();
lblResult.Text = "结¨¢果?:êo" + PostWebRequest(postUrl, menuInfo);
}
/// <summary>
/// 获取微信 access_token
/// </summary>
/// <returns></returns>
protected string GetAccessToken()
{
string accessToken = string.Empty;
string getUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}";
getUrl = string.Format(getUrl, "你的appid", "你的secret");
Uri uri = new Uri(getUrl);
HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(uri);
webReq.Method = "POST"; //获取返回信息
HttpWebResponse response = (HttpWebResponse)webReq.GetResponse();
StreamReader streamReader = new StreamReader(response.GetResponseStream(), Encoding.Default);
string returnJason = streamReader.ReadToEnd(); JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(returnJason);
object value;
if (json.TryGetValue("access_token", out value))
{
accessToken = value.ToString();
}
return accessToken;
}
/// <summary>
///菜单内容 /// </summary>
/// <returns></returns>
private string getMenuInfo()
{
//现暂时写死
string menu = "{" +
"\"button\":[" +
"{" +
"\"name\":\"服务\"," +
"\"sub_button\":[" +
"{" +
"\"type\":\"view\"," +
"\"name\":\"更多服务\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=
appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=6&response_type=code&scope=snsapi_base&state=6#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\"更多服务1\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=10&response_type=code&scope=snsapi_base&state=10#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\" 更多服务2\"," + "\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=11&response_type=code&scope=snsapi_base&state=11#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\"更多服务3\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=6&response_type=code&scope=snsapi_base&state=6#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\"更多服务4 \"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=6&response_type=code&scope=snsapi_base&state=6#wechat_redirect\"" +
"}]}," +
"{" +
"\"name\":\"业务\"," +
"\"sub_button\":[" +
"{" +
"\"type\":\"view\"," +
"\"name\":\"业务1\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=5&response_type=code&scope=snsapi_base&state=5#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\"业务2\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=6&response_type=code&scope=snsapi_base&state=6#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\"业务3\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=7&response_type=code&scope=snsapi_base&state=7#wechat_redirect\"" +
"}," +
"{" +
"\"type\":\"view\"," +
"\"name\":\"业务4\"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=8&response_type=code&scope=snsapi_base&state=8#wechat_redirect\"" +
"}]" +
"}," +
"{" +
"\"name\":\"办理\"," +
"\"sub_button\":[" +
"{" +
"\"type\":\"view\"," +
"\"name\":\"办理1 \"," +
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=14&response_type=code&scope=snsapi_base&state=14#wechat_redirect\"" +
"}," +
"{"+
"\"type\":\"view\","+
"\"name\":\"办理2\","+
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=1&response_type=code&scope=snsapi_base&state=1#wechat_redirect\"" +
"},"+
"{"+
"\"type\":\"view\","+
"\"name\":\"办理3\","+
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=2&response_type=code&scope=snsapi_base&state=2#wechat_redirect\"" +
"},"+
"{"+
"\"type\":\"view\","+
"\"name\":\"办理4\","+
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=3&response_type=code&scope=snsapi_base&state=3#wechat_redirect\"" +
"},"+
"{"+
"\"type\":\"view\","+
"\"name\":\"办理5\","+
"\"url\":\"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appid&redirect_uri=http://192.168.0.199/weixin/WeixinCommon.ashx?action=4&response_type=code&scope=snsapi_base&state=4#wechat_redirect\"" +
"}]}]}";
return menu;
} /// <summary>
/// 写入
/// </summary>
/// <param name=\"postUrl\"></param>
/// <param name=\"menuInfo\"></param>
/// <returns></returns>
private string PostWebRequest(string postUrl, string menuInfo)
{
string returnValue = string.Empty;
try
{
byte[] byteData = Encoding.UTF8.GetBytes(menuInfo);
Uri uri = new Uri(postUrl);
HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(uri);
webReq.Method = "POST";
webReq.ContentType = "application/x-www-form-urlencoded";
webReq.ContentLength = byteData.Length;
//定义Stream信息
Stream stream = webReq.GetRequestStream();
stream.Write(byteData, , byteData.Length);
stream.Close();
//获取返回信息
HttpWebResponse response = (HttpWebResponse)webReq.GetResponse();
StreamReader streamReader = new StreamReader(response.GetResponseStream(), Encoding.Default);
returnValue = streamReader.ReadToEnd();
//关闭
streamReader.Close();
response.Close();
stream.Close();
}
catch (Exception ex)
{
lblResult.Text = ex.ToString();
}
return returnValue;
} /// <summary>
///删除菜单
/// </summary>
/// <param name=\"sender\"></param>
/// <param name=\"e\"></param>
protected void btnDeleteMenu_Click(object sender, EventArgs e)
{
string postUrl = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token={0}";
postUrl = string.Format(postUrl, GetAccessToken());
string menuInfo = getMenuInfo();
lblResult.Text = "结¨¢果?:êo" + PostWebRequest(postUrl, menuInfo);
} Aspx视图中
<asp:Button ID="btnCreateMenu" runat="server" Text="创ä¡ä建¡§菜?单Ì£¤"
onclick="btnCreateMenu_Click" />
<asp:Button ID="btnDeleteMenu" runat="server" Text="删¦?除y菜?单Ì£¤"
onclick="btnDeleteMenu_Click" />
<asp:Label ID="lblResult" runat="server" Text="结¨¢果?"></asp:Label>
</form>

7.接口逻辑操作 统一接口

(1)菜单也可以为:

"\"type\":\"click\"," +

"\"name\":\"快乐每一天\"," +

"\"key\":\"yc_jbcg\""+

以xml文本形式传递参数

(2)代码

/// <summary>
/// 微信统一接口
/// </summary>
/// <param name="context"></param>
//string postStr = "";
HttpContext context;
public void ProcessRequest(HttpContext context)
{
string getStr = ""; //接收参数
this.context = context;
Stream s = context.Request.InputStream; //获取传入的stream
byte[] b = new byte[s.Length];
s.Read(b, , (int)s.Length);
getStr = Encoding.UTF8.GetString(b);
Common.Log.WriteLog("接口记录每次微信请求信?息:" + getStr);
if (!string.IsNullOrEmpty(getStr))
{
responseMsg(getStr,context);
}
} public void responseMsg(string postStr,HttpContext context)
{
try
{
System.Xml.XmlDocument postObj = new System.Xml.XmlDocument();
postObj.LoadXml(postStr);
//Common.Log.WriteLog("responseMsg:-------" + postStr);
var FromUserNameList = postObj.GetElementsByTagName("FromUserName");
string FromUserName = string.Empty;
for (int i = ; i < FromUserNameList.Count; i++)
{
if (FromUserNameList[i].ChildNodes[].NodeType == System.Xml.XmlNodeType.CDATA)
{
FromUserName = FromUserNameList[i].ChildNodes[].Value;
//Common.Log.WriteLog("FromUserName:-------" + FromUserName);
}
} var toUsernameList = postObj.GetElementsByTagName("ToUserName");
string ToUserName = string.Empty;
for (int i = ; i < toUsernameList.Count; i++)
{
if (toUsernameList[i].ChildNodes[].NodeType == System.Xml.XmlNodeType.CDATA)
{
ToUserName = toUsernameList[i].ChildNodes[].Value;
//Common.Log.WriteLog("ToUserName:-------" + ToUserName);
}
} var toMsgTypeList = postObj.GetElementsByTagName("MsgType");
string toMsgType = string.Empty;
for (int i = ; i < toMsgTypeList.Count; i++)
{
if (toMsgTypeList[i].ChildNodes[].NodeType == System.Xml.XmlNodeType.CDATA)
{
toMsgType = toMsgTypeList[i].ChildNodes[].Value;
//Common.Log.WriteLog("toMsgType:-------" + toMsgType);
}
} var keywordList = postObj.GetElementsByTagName("Content");
string Content = string.Empty;
for (int i = ; i < keywordList.Count; i++)
{
if (keywordList[i].ChildNodes[].NodeType == System.Xml.XmlNodeType.CDATA)
{
Content = keywordList[i].ChildNodes[].Value;
}
}
var textpl = "";
if (toMsgType == "text")
{
var time = DateTime.Now;
textpl = "<xml><ToUserName><![CDATA[" + FromUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + ToUserName + "]]></FromUserName>" +
"<CreateTime>" + ConvertDateTimeInt(DateTime.Now) + "</CreateTime><MsgType><![CDATA[text]]></MsgType>" +
"<Content><![CDATA[您好,欢迎观看]]></Content><FuncFlag>0</FuncFlag></xml>";
}
else if (toMsgType == "event")
{
var toEventList = postObj.GetElementsByTagName("Event");
string toEvent = string.Empty;
for (int i = ; i < toEventList.Count; i++)
{
if (toEventList[i].ChildNodes[].NodeType == System.Xml.XmlNodeType.CDATA)
{
toEvent = toEventList[i].ChildNodes[].Value;
//Common.Log.WriteLog("toEvent:-------" + toEvent);
}
} var toEventKeyList = postObj.GetElementsByTagName("EventKey");
string toEventKey = string.Empty;
for (int i = ; i < toEventKeyList.Count; i++)
{
if (toEventKeyList[i].ChildNodes[].NodeType == System.Xml.XmlNodeType.CDATA)
{
toEventKey = toEventKeyList[i].ChildNodes[].Value;
//Common.Log.WriteLog("toEventKey:-------" + toEventKey);
}
}
//只有两个 暂时写
if (toEvent.ToLower() == "click" && toEventKey.ToLower() == "yc_jbcg")
{
string ResultStr = JCBindCarownerId(FromUserName, context);
var time = DateTime.Now;
textpl = "<xml><ToUserName><![CDATA[" + FromUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + ToUserName + "]]></FromUserName>" +
"<CreateTime>" + ConvertDateTimeInt(DateTime.Now) + "</CreateTime><MsgType><![CDATA[text]]></MsgType>" +
"<Content><![CDATA[" + ResultStr + "]]></Content><FuncFlag>0</FuncFlag></xml>";
}
if (toEvent.ToLower() == "click" && toEventKey.ToLower() == "yc_pm")
{
string Scontent="欢迎光临,请登录MyTaobao查看";
textpl = "<xml><ToUserName><![CDATA[" + FromUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + ToUserName + "]]></FromUserName>" +
"<CreateTime>" + ConvertDateTimeInt(DateTime.Now) + "</CreateTime><MsgType><![CDATA[text]]></MsgType>" +
"<Content><![CDATA[" + Scontent + "]]></Content><FuncFlag>0</FuncFlag></xml>";
}
if (toEvent.ToLower() == "subscribe")
{
var time = DateTime.Now;
textpl = "<xml><ToUserName><![CDATA[" + FromUserName + "]]></ToUserName>" +
"<FromUserName><![CDATA[" + ToUserName + "]]></FromUserName>" +
"<CreateTime>" + ConvertDateTimeInt(DateTime.Now) + "</CreateTime><MsgType><![CDATA[text]]></MsgType>" +
"<Content><![CDATA[您好?感D谢关注官方微信]]></Content><FuncFlag>0</FuncFlag></xml> ";
}
else if (toEvent.ToLower() == "unsubscribe")
{
}
}
//Common.Log.WriteLog("textpl:-------" + textpl);
System.Web.HttpContext.Current.Response.Write(textpl);
}
catch (Exception ex)
{
Common.Log.WriteLog("微信统一接口错误信息:" + ex.Message);
}
} private int ConvertDateTimeInt(System.DateTime time)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(, , ));
return (int)(time - startTime).TotalSeconds;
}

8.Get请求

(1)接收信息 获取用户唯一openid

/// <summary>
/// 微信统一接口
/// </summary>
/// <param name="context"></param>
public void ProcessRequest(HttpContext context)
{
#region 保存每次微信请求信息
Uri Url = context.Request.Url; //获取url连接
Common.Log.WriteLog("WeixinCommon接口记录每次微信请求具体信息:" + Url); #endregion object action = context.Request.QueryString["action"]; //action 区分用户点击的内容
object code = context.Request.QueryString["code"]; //code
string appid = ConfigurationManager.AppSettings["appid"]; //appid
string secret = ConfigurationManager.AppSettings["secret"]; //secret
if (action != null && action.ToString() != "" && code != null && code.ToString() != "")
{
StringBuilder postUrl = new StringBuilder();
postUrl.AppendFormat("https://api.weixin.qq.com/sns/oauth2/access_token?appid={0}&secret={1}&code={2}&grant_type=authorization_code", appid, secret, code); string openid = PostWebRequest(postUrl.ToString());
//Common.Log.WriteLog("openid Common页°3面?:êo" + openid);
PostWebPageByopenId(Convert.ToInt32(action), openid, context);
}
else
{
action = action==null ? "null" : action;
code = code == null ? "null" : code;
Common.Log.WriteLog("action==" + (string.IsNullOrEmpty(action.ToString())? "null" : action) + "\\code=" +( string.IsNullOrEmpty(code.ToString())? "null" : code));
}
}
/// <summary>
/// 根据url请求openid
/// </summary>
/// <param name=\"postUrl\"></param>
/// <param name=\"menuInfo\"></param>
/// <returns></returns>
private string PostWebRequest(string postUrl)
{
string returnValue = string.Empty;
try
{
Uri uri = new Uri(postUrl);
HttpWebRequest webReq = (HttpWebRequest)WebRequest.Create(uri);
webReq.Method = "POST";
webReq.ContentType = "application/x-www-form-urlencoded";
//获取返回信息
HttpWebResponse response = (HttpWebResponse)webReq.GetResponse();
StreamReader streamReader = new StreamReader(response.GetResponseStream(), Encoding.Default);
returnValue = streamReader.ReadToEnd(); JavaScriptSerializer serializer = new JavaScriptSerializer();
Dictionary<string, object> json = (Dictionary<string, object>)serializer.DeserializeObject(returnValue);
object value;
if (json.TryGetValue("openid", out value))
{
returnValue = value.ToString();
}
if (returnValue.Contains("errcode"))
returnValue = "";
return returnValue;
}
catch (Exception ex)
{
Common.Log.WriteLog("微信返回内容信息" + ex);
}
return returnValue;
}

(2)业务处理

/// <summary>
/// 根据条件,判断用户选择的页面
/// </summary>
/// <param name="action">页面参数</param>
private void PostWebPageByopenId(int action,string openid,HttpContext context)
{ string strwhere = " openid='" + openid + "'";
BLL.WeiXin wxbll = new BLL.WeiXin();
IList< Model.WeiXin> wxList = wxbll.GetModelList(strwhere);
if (wxList.Count > )
{
try
{
context.Session["openid"] = wxList[].OpenID;
Model.TemUser Usermodel = new BLL.TemUser().GetUser(Convert.ToInt32(wxList[].Userid));
context.Session["CarUser"] = Usermodel;
context.Session["UserLogin"] = true;
}
catch (Exception ex)
{
Common.Log.WriteLog("微信接口错误信息" + ex.Message);
}
}
else
{
context.Response.Redirect("/Login.aspx?openid=" + openid);
return;
}
// } switch (action)
{
case :
context.Response.Redirect("/myFuWu.aspx");
break;
case :
context.Response.Redirect("/myYeWu.aspx");
break;
default:
context.Response.Redirect("/Login.aspx?openid=" + openid);
break;
}
}

(3)页面做相应功能处理 大概功能流程如下图

微信平台接入Web页面功能接口(C#)的更多相关文章

  1. 微信移动端web页面调试小技巧

    技术贴还是分享出来更加好,希望能对一些朋友有帮助,个人博客  http://lizhug.com/mymajor/微信移动端web页面调试小技巧

  2. 从APP跳转到微信指定联系人聊天页面功能的实现与采坑之旅

    起因: 最近做的APP中有一个新功能:已知用户微信号,可点击直接跳转到当前用户微信聊天窗口页面. 当时第一想法是使用无障碍来做,并且觉得应该不难,只是逻辑有点复杂.没想到最终踩了好多坑,特地把踩过的坑 ...

  3. C#开发微信门户及应用(28)--微信“摇一摇·周边”功能的使用和接口的实现

    ”摇一摇周边“是微信提供的一种新的基于位置的连接方式.用户通过“摇一摇”的“周边”页卡,可以与线下商户进行互动,获得商户提供的个性化的服务.微信4月份有一个赠送摇一摇设备的活动,我们有幸获得赠送资格, ...

  4. 转:Web页面通过URL地址传递参数常见问题及检测方法

    Web页面即我们在浏览器中所看到的网页,在Web应用程序中,其页面往往需要进行动态切换和数据交互,页面间的数据常规传递方法有多种,本文主要介绍Web页面处理程序中常见的URL地址参数传递方法,包括概述 ...

  5. appium处理app与web页面的转换

      测微信页面的时候使用谷歌app,进入微信页面的链接 def setUp(self): print("set up env for android testing...") se ...

  6. Senparc.Weixin.MP SDK 微信公众平台开发教程(十八):Web代理功能

    在Senparc.Weixin.dll v4.5.7版本开始,我们提供了Web代理功能,以方便在受限制的局域网内的应用可以顺利调用接口. 有关的修改都在Senparc.Weixin/Utilities ...

  7. 微信开发之移动手机WEB页面(HTML5)Javascript实现一键拨号及短信发送功能

    在做一个微信的微网站中的一个便民服务电话功能的应用,用到移动web页面中列出的电话号码,点击需要实现调用通讯录,网页一键拨号的拨打电话功能. 如果需要在移动浏览器中实现拨打电话,发送email,美国服 ...

  8. [HTML] 微信开发之移动手机WEB页面(HTML5)Javascript实现一键拨号及短信发送功能

    在做一个微信的微网站中的一个便民服务电话功能的应用,用到移动web页面中列出的电话号码,点击需要实现调用通讯录,网页一键拨号的拨打电话功能. 如果需要在移动浏览器中实现拨打电话,发送email,美国服 ...

  9. 微信平台ASPX高级定制开发(一):如何使用C#建立响应微信接入和自动回复的代码

    微信平台不解释了,如果不了解的百度一下下,如果不会用微信,请自宫,光盘重启电脑,打开CMD输入Format C:.网上有很多针对企业级的高级定制ASPX开发,写得草草了事,很多男人干事都草草了事,这可 ...

随机推荐

  1. Storm几篇文章

    http://tianhailong.com/ http://www.cnblogs.com/panfeng412/archive/2012/07/02/storm-common-patterns-o ...

  2. 射频识别技术漫谈(7)——ID卡

    ID(Identification)是识别的意思,ID卡就是识别卡.ID卡包含范围广泛,只要具有识别功能的卡片都可以叫ID卡,例如条码卡,磁卡都可以是ID卡,我们这儿说的当然是射频识别卡. 射频ID卡 ...

  3. 转:详细解说 STL 排序(Sort)

    详细解说 STL 排序(Sort) 详细解说 STL 排序(Sort) 作者Winter 详细解说 STL 排序(Sort) 0 前言: STL,为什么你必须掌握 1 STL提供的Sort 算法 1. ...

  4. What is a good EPUB reader on Linux

    Last updated on August 20, 2014 Authored by Adrien Brochard 12 Comments If the habit on reading book ...

  5. JavaScript中的事件处理程序

    JavaScript和HTML之间的交互是通过事件实现的.事件,就是文档或者浏览器窗口中发生的一些特定的交互瞬间.可以使用事件处理程序来预订事件,以便在事件发生的时候执行响应的代码.这种观察者模式的模 ...

  6. 碰撞缓冲效果的导航条 js

  7. 关于hibernate子查询参数的问题

    private Map<String, Object> createWblHqlContext(boolean needGroup, String startDate, String en ...

  8. Reverse Integer - Palindrome Number - 简单模拟

    第一个题目是将整数进行反转,这个题实现反转并不难,主要关键点在于如何进行溢出判断.溢出判断再上一篇字符串转整数中已有介绍,本题采用其中的第三种方法,将数字转为字符串,使用字符串比较大小的方法进行比较. ...

  9. 「Foundation」字符串

    一.Foundation框架中一些常用的类 字符串型: NSString:不可变字符串 NSMutableString:可变字符串 集合型: 1)NSArray:OC不可变数组  NSMutableA ...

  10. HTML5 总结-地理定位-6

    HTML5 地理定位 定位用户的位置 HTML5 Geolocation API 用于获得用户的地理位置. 鉴于该特性可能侵犯用户的隐私,除非用户同意,否则用户位置信息是不可用的. 浏览器支持 Int ...