Public number third-party platform development tutorial Create a third-party platform for the public
Public number third-party platform development Tutorials two component_verify_ticket and Accesstoken access
Public number third party platform development Tutorials III Public License third party platform
Public number third-party platform development tutorial four-generation public number Launch page authorization instructions
Public number third party platform development Tutorial Five Dynasties public number processing messages and events
Public number third-party platform development tutorial Six generations of the public number using the JS SDK instructions
Another, thanks to this prawn blog, these things are in his blog based on the completion of his blog has some interface code can be downloaded
Development Series Tutorials
This part focuses on the configuration, and other things just look at the official documents.
Get the Jsapi_ticket function
/// <summary> ///Get Jsapi_ticket/// </summary> /// <returns></returns> Private stringGetTicket () {stringTicket =string. Empty; Member_model MemberInfo=MEMBER_BLL. Getmodelbykeyfiled (MemberID); stringtoken =Memberinfo.authorizeraccesstoken; AppID= Memberinfo.authorizerappid;//This is for the ppid of the service, not the AppID of the public number. stringresult = Post ("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token="+ token +"&type=jsapi",""); Jobject Objresult=(Jobject) jsonconvert.deserializeobject (result); Ticket= objresult.value<string> ("Ticket"); returnticket; }
Generation of Signature
Private voidBind () {Weixininterface.refreshandupdatetoken (MemberID); //Refresh the token of the service partytimestamp = Convertdatetimeint (DateTime.Now). ToString ();//time StampNoncestr = Generatenoncestr ( -);//randomly generated stringTicket =GetTicket (); stringURL ="http://****/jspage.aspx?memberid="+MemberID; * Number of members to replace their own domain namestringTempStr =string. Format ("Jsapi_ticket={0}&noncestr={1}×tamp={2}&url={3}", ticket, noncestr, timestamp, URL); Logtool.logtodirdest (FilePath, Logtype.debug, Pageurl+"get to the plaintext:"+tempstr); Signature=System.Web.Security.FormsAuthentication. HashPasswordForStoringInConfigFile (TempStr,"SHA1"). ToLower (); Logtool.logtodirdest (FilePath, Logtype.debug, Pageurl+"get to the signature:"+signature); //Response.Write (TESTSTR);}
Front Desk JS page configuration
Public number third-party platform development tutorial Six generations of the public number using the JS SDK instructions