C # share detailed code on WeChat,

Source: Internet
Author: User

C # share detailed code,
The examples in this article share the code shared by C # For your reference. The details are as follows:

Share code

Obtain the signature:

mui.ajax('/apijson/wxsign', {type: 'get',data: {url: location.href,},success: function (data) {//alert(JSON.stringify(data));wx.config({

Debug: false, // enable the debugging mode. The returned values of all called APIs are displayed on the alert client. To view the input parameters, open them on the pc, the parameter information is output through log and printed only on the pc end.

AppId: data. appid, // required. timestamp is the unique identifier of the public number. timestamp, // required. The signature timestamp nonceStr: data. nonceStr, // required. The random string signature: data. signature, // required, signature jsApiList: ['onmenusharetimeline ', 'onmenushareappmessage', 'startrecord', 'stoprecord ', 'alipay', 'playvoice', 'pausevoice ', 'stopvoice', 'onvoiceplayend', 'uploadvoice ', 'downloadvoice', 'chooseimag', 'previewimage', 'uploadimage', 'downloadimage'] // required, list of JS interfaces to be used });}})

Share code:

Wx. ready (function () {var url = window. location. href; // call APIwx here. onMenuShareAppMessage ({title: "Yu Yuandan-send your parents and those most grateful to you! ", // Share the title" desc: "Long-term use of Party and army leaders, such as zhipindeng Xiaoping, Yang Shangkun, and Ye Jianying, out of the red wall! ", // Share description link: url, // share link imgUrl:" https://m.981china.com/images/yuyuandanlogo.png ", // share icon type:'', // dataUrl :'', // if the type is music or video, a data link is provided. The default value is success: function () {// callback function executed after the user confirms the sharing}. cancel: function () {// callback function executed after the user cancels the sharing}); wx. onMenuShareTimeline ({title: "Yu Yuandan-send your parents and those most grateful! ", // Share the title" desc: "Long-term use of Party and army leaders, such as zhipindeng Xiaoping, Yang Shangkun, and Ye Jianying, out of the red wall! ", // Share description link: url, // share link imgUrl:" https://m.981china.com/images/yuyuandanlogo.png ", // share icon type:'', // dataUrl :'', // if the type is music or video, a data link is provided. The default value is success: function () {// callback function executed after the user confirms the sharing}. cancel: function () {// callback function executed after the user cancels the sharing }});});

Json output by wxsign

{"appid": "wx888888888888","jsapi_ticket": "bxLdikRXVbTPdHSM05e5u2WtcuareekEvI9AoiSB9hYDykHA-zgWRJIeoZkZivtjOGcI87SVk1r8888888888","timestamp": 150358888,"nonceStr": "ESbJrsnzGHi8888","signature": "fec1a26592ef07d52ff066183f50536888888888f5"

 

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.