Public number third-party platform development tutorial Six generations of the public number using the JS SDK instructions

Source: Internet
Author: User

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}&timestamp={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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.