ASP call SDK Share friends on wechat 、 Circle of friends needs to use sha1.asp, I'll start with the main code , And then attach it sha1.asp, It's convenient for you to copy the past directly .

page :shara.asp

 1 <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
2 <!--#include file="sha1.asp"-->
3 <%
4 On Error Resume Next
5 Dim WxObj
6 Set WxObj = Server.CreateObject("WeixinDLL.WeixinClass")
7 WxObj.SetAppID = "AppID"
8 WxObj.SetAppSecret = "AppSecret"
9
10 Dim token,JsapiTicket,timestamp,nonceStr,signature,sha1Url
11 token = WxObj.Get_Token() ' Current user's access_token
12 If Trim(token) = "" Or IsNull(token) Then Response.Write " No valid access_token, Result in template message sending failure !" : Response.End()
13 sha1Url = "https://www.domain.com/shara/shara.asp"
14 timestamp = WxObj.ToUnixTime(now)
15 nonceStr = WxObj.MakeRanNumChar(12)
16 JsapiTicket = WxObj.Get_Ticket(token)
17 signature = Get_signature(JsapiTicket,nonceStr,timestamp,sha1Url)
18 signature=sha1("jsapi_ticket=" & JsapiTicket & "&noncestr=" & nonceStr & "&timestamp=" & timestamp & "&url=" & sha1Url & "")
19 Set WxObj = Nothing
20 If Err Then Response.Write Err.Description
21 %>
22 <!DOCTYPE html>
23 <html>
24 <head>
25 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
26 <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
27 <title> Friends share 、 Circle of friends </title>
28 <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
29 </head>
30 <body>
31 <div style="display:block; width:95%; height:300px; border:1px solid #ddd; background:#f2f2f2; margin:20px auto;">
32 <div id="showid"> Share with friends 、 Circle of friends , Click the share panel to test try </div>
33 </div>
34 <script type="text/javascript">
35 window.onload = function(){
36 wx.config({
37     debug: false,// Turn on debugging mode , Call all api The return value of will be on the client side alert come out , To see the parameters passed in , Can be in pc End open , The parameter information will go through log play , Only in pc Only when the end is printed .
38     appId: "<%=AppID%>",
39     timestamp: "<%=timestamp%>",
40     nonceStr: "<%=nonceStr%>",
41     signature: "<%=signature%>",
42     jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','updateTimelineShareData','updateAppMessageShareData']  /* All to call API Add them to this list */
43 });
44 //----------------------------------------------------
45 wx.ready(function(){
46 var Url = "https://www.domain.com/shara/shara.asp";
47 var Title = " Yuen SenMei ";
48 var Description = " Yuansenmei fruit enzyme powder : Pure green health products of Hunan yuanshengkang Biotechnology Co., Ltd !";
49 var ImgUrl = "https://www.domain.com/img/smal.jpg";
50 // Share with friends
51 wx.onMenuShareTimeline({
52 title: Title, // Share the title
53 link: Url, // Share links
54 imgUrl: ImgUrl, // Share icon
55 success: function () {
56 // Callback function executed after user confirms sharing
57 },
58 cancel: function () {
59 // Callback function executed after user cancels sharing
60 }
61 });
62 // Share with wechat friends
63 wx.onMenuShareAppMessage({
64 title: Title, // Share the title
65 desc: Description, // Share description
66 link: Url, // Share links
67 imgUrl: ImgUrl, // Share icon
68 success: function () {
69 // Callback function executed after user confirms sharing
70 },
71 cancel: function () {
72 // Callback function executed after user cancels sharing
73 }
74 });
75 wx.updateTimelineShareData({
76 title: Title,
77 link: Url,
78 imgUrl: ImgUrl,
79 success: function(){}
80 });
81 //  Customize “ Share with friends ” And “ Share the QQ” Button sharing content
82 wx.updateAppMessageShareData({
83 title: Title,
84 desc: Description,
85 link: Url,
86 imgUrl: ImgUrl,
87 success: function(){}
88 });
89
90 });
91 //----------------------------------------------------
92 }
93 </script>
94 </body>
95 </html>

This code uses WeixinDLL, Please contact me if you need VX:z18670092211

sha1.asp Page code

 1 <script language="JScript" runAt="server">
2 // MD5 SHA1 share
3 function add(x, y)
4 {
5   return ((x&0x7FFFFFFF) + (y&0x7FFFFFFF)) ^ (x&0x80000000) ^ (y&0x80000000);
6 }
7
8 // MD5
9 function MD5hex(i)
10 {
11   var sHex = "0123456789abcdef"
12   h = "";
13   for(j = 0; j <= 3; j++)
14   {
15     h += sHex.charAt((i >> (j * 8 + 4)) & 0x0F) +
16          sHex.charAt((i >> (j * 8)) & 0x0F);
17   }
18   return h;
19 }
20
21 function R1(A, B, C, D, X, S, T)
22 {
23   q = add(add(A, (B & C) | (~B & D)), add(X, T));
24   return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
25 }
26
27 function R2(A, B, C, D, X, S, T)
28 {
29   q = add(add(A, (B & D) | (C & ~D)), add(X, T));
30   return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
31 }
32
33 function R3(A, B, C, D, X, S, T)
34 {
35   q = add(add(A, B ^ C ^ D), add(X, T));
36   return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
37 }
38
39 function R4(A, B, C, D, X, S, T)
40 {
41   q = add(add(A, C ^ (B | ~D)), add(X, T));
42   return add((q << S) | ((q >> (32 - S)) & (Math.pow(2, S) - 1)), B);
43 }
44
45 function MD5(sInp) {
46   var sAscii = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
47   wLen = (((sInp.length + 8) >> 6) + 1) << 4;
48   var X = new Array(wLen);
49
50   j = 4;
51   for (i = 0; (i * 4) < sInp.length; i++)
52   {
53     X[i] = 0;
54     for (j = 0; (j < 4) && ((j + i * 4) < sInp.length); j++)
55     {
56       X[i] += (sAscii.indexOf(sInp.charAt((i * 4) + j)) + 32) << (j * 8);
57     }
58   }
59
60   if (j == 4)
61   {
62     X[i++] = 0x80;
63   }
64   else
65   {
66     X[i - 1] += 0x80 << (j * 8);
67   }
68   for(; i < wLen; i++) { X[i] = 0; }
69   X[wLen - 2] = sInp.length * 8;
70
71   a = 0x67452301;
72   b = 0xefcdab89;
73   c = 0x98badcfe;
74   d = 0x10325476;
75
76   for (i = 0; i < wLen; i += 16) {
77     aO = a;
78     bO = b;
79     cO = c;
80     dO = d;
81
82     a = R1(a, b, c, d, X[i+ 0], 7 , 0xd76aa478);
83     d = R1(d, a, b, c, X[i+ 1], 12, 0xe8c7b756);
84     c = R1(c, d, a, b, X[i+ 2], 17, 0x242070db);
85     b = R1(b, c, d, a, X[i+ 3], 22, 0xc1bdceee);
86     a = R1(a, b, c, d, X[i+ 4], 7 , 0xf57c0faf);
87     d = R1(d, a, b, c, X[i+ 5], 12, 0x4787c62a);
88     c = R1(c, d, a, b, X[i+ 6], 17, 0xa8304613);
89     b = R1(b, c, d, a, X[i+ 7], 22, 0xfd469501);
90     a = R1(a, b, c, d, X[i+ 8], 7 , 0x698098d8);
91     d = R1(d, a, b, c, X[i+ 9], 12, 0x8b44f7af);
92     c = R1(c, d, a, b, X[i+10], 17, 0xffff5bb1);
93     b = R1(b, c, d, a, X[i+11], 22, 0x895cd7be);
94     a = R1(a, b, c, d, X[i+12], 7 , 0x6b901122);
95     d = R1(d, a, b, c, X[i+13], 12, 0xfd987193);
96     c = R1(c, d, a, b, X[i+14], 17, 0xa679438e);
97     b = R1(b, c, d, a, X[i+15], 22, 0x49b40821);
98
99     a = R2(a, b, c, d, X[i+ 1], 5 , 0xf61e2562);
100     d = R2(d, a, b, c, X[i+ 6], 9 , 0xc040b340);
101     c = R2(c, d, a, b, X[i+11], 14, 0x265e5a51);
102     b = R2(b, c, d, a, X[i+ 0], 20, 0xe9b6c7aa);
103     a = R2(a, b, c, d, X[i+ 5], 5 , 0xd62f105d);
104     d = R2(d, a, b, c, X[i+10], 9 ,  0x2441453);
105     c = R2(c, d, a, b, X[i+15], 14, 0xd8a1e681);
106     b = R2(b, c, d, a, X[i+ 4], 20, 0xe7d3fbc8);
107     a = R2(a, b, c, d, X[i+ 9], 5 , 0x21e1cde6);
108     d = R2(d, a, b, c, X[i+14], 9 , 0xc33707d6);
109     c = R2(c, d, a, b, X[i+ 3], 14, 0xf4d50d87);
110     b = R2(b, c, d, a, X[i+ 8], 20, 0x455a14ed);
111     a = R2(a, b, c, d, X[i+13], 5 , 0xa9e3e905);
112     d = R2(d, a, b, c, X[i+ 2], 9 , 0xfcefa3f8);
113     c = R2(c, d, a, b, X[i+ 7], 14, 0x676f02d9);
114     b = R2(b, c, d, a, X[i+12], 20, 0x8d2a4c8a);
115
116     a = R3(a, b, c, d, X[i+ 5], 4 , 0xfffa3942);
117     d = R3(d, a, b, c, X[i+ 8], 11, 0x8771f681);
118     c = R3(c, d, a, b, X[i+11], 16, 0x6d9d6122);
119     b = R3(b, c, d, a, X[i+14], 23, 0xfde5380c);
120     a = R3(a, b, c, d, X[i+ 1], 4 , 0xa4beea44);
121     d = R3(d, a, b, c, X[i+ 4], 11, 0x4bdecfa9);
122     c = R3(c, d, a, b, X[i+ 7], 16, 0xf6bb4b60);
123     b = R3(b, c, d, a, X[i+10], 23, 0xbebfbc70);
124     a = R3(a, b, c, d, X[i+13], 4 , 0x289b7ec6);
125     d = R3(d, a, b, c, X[i+ 0], 11, 0xeaa127fa);
126     c = R3(c, d, a, b, X[i+ 3], 16, 0xd4ef3085);
127     b = R3(b, c, d, a, X[i+ 6], 23,  0x4881d05);
128     a = R3(a, b, c, d, X[i+ 9], 4 , 0xd9d4d039);
129     d = R3(d, a, b, c, X[i+12], 11, 0xe6db99e5);
130     c = R3(c, d, a, b, X[i+15], 16, 0x1fa27cf8);
131     b = R3(b, c, d, a, X[i+ 2], 23, 0xc4ac5665);
132
133     a = R4(a, b, c, d, X[i+ 0], 6 , 0xf4292244);
134     d = R4(d, a, b, c, X[i+ 7], 10, 0x432aff97);
135     c = R4(c, d, a, b, X[i+14], 15, 0xab9423a7);
136     b = R4(b, c, d, a, X[i+ 5], 21, 0xfc93a039);
137     a = R4(a, b, c, d, X[i+12], 6 , 0x655b59c3);
138     d = R4(d, a, b, c, X[i+ 3], 10, 0x8f0ccc92);
139     c = R4(c, d, a, b, X[i+10], 15, 0xffeff47d);
140     b = R4(b, c, d, a, X[i+ 1], 21, 0x85845dd1);
141     a = R4(a, b, c, d, X[i+ 8], 6 , 0x6fa87e4f);
142     d = R4(d, a, b, c, X[i+15], 10, 0xfe2ce6e0);
143     c = R4(c, d, a, b, X[i+ 6], 15, 0xa3014314);
144     b = R4(b, c, d, a, X[i+13], 21, 0x4e0811a1);
145     a = R4(a, b, c, d, X[i+ 4], 6 , 0xf7537e82);
146     d = R4(d, a, b, c, X[i+11], 10, 0xbd3af235);
147     c = R4(c, d, a, b, X[i+ 2], 15, 0x2ad7d2bb);
148     b = R4(b, c, d, a, X[i+ 9], 21, 0xeb86d391);
149
150     a = add(a, aO);
151     b = add(b, bO);
152     c = add(c, cO);
153     d = add(d, dO);
154   }
155   
156    MD5Value=MD5hex(a) + MD5hex(b) + MD5hex(c) + MD5hex(d);
157    return MD5Value.toUpperCase();
158 }
159
160
161 // SHA1
162
163 function SHA1hex(num)
164 {
165   var sHEXChars="0123456789abcdef";
166   var str="";
167   for(var j=7;j>=0;j--)
168     str+=sHEXChars.charAt((num>>(j*4))&0x0F);
169   return str;
170 }
171
172 function AlignSHA1(sIn){
173   var nblk=((sIn.length+8)>>6)+1, blks=new Array(nblk*16);
174   for(var i=0;i<nblk*16;i++)blks[i]=0;
175   for(i=0;i<sIn.length;i++)
176     blks[i>>2]|=sIn.charCodeAt(i)<<(24-(i&3)*8);
177   blks[i>>2]|=0x80<<(24-(i&3)*8);
178   blks[nblk*16-1]=sIn.length*8;
179   return blks;
180 }
181
182
183 function rol(num,cnt){
184   return(num<<cnt)|(num>>>(32-cnt));
185 }
186
187 function ft(t,b,c,d){
188   if(t<20)return(b&c)|((~b)&d);
189   if(t<40)return b^c^d;
190   if(t<60)return(b&c)|(b&d)|(c&d);
191   return b^c^d;
192 }
193
194 function kt(t) {
195   return(t<20)?1518500249:(t<40)?1859775393:
196     (t<60)?-1894007588:-899497514;
197 }
198
199 function SHA1(sIn)
200 {
201   var x=AlignSHA1(sIn);
202   var w=new Array(80);
203   var a=1732584193;
204   var b=-271733879;
205   var c=-1732584194;
206   var d=271733878;
207   var e=-1009589776;
208   for(var i=0;i<x.length;i+=16){
209     var olda=a;
210     var oldb=b;
211     var oldc=c;
212     var oldd=d;
213     var olde=e;
214     for(var j=0;j<80;j++){
215       if(j<16)w[j]=x[i+j];
216       else w[j]=rol(w[j-3]^w[j-8]^w[j-14]^w[j-16],1);
217       t=add(add(rol(a,5),ft(j,b,c,d)),add(add(e,w[j]),kt(j)));
218       e=d;
219       d=c;
220       c=rol(b,30);
221       b=a;
222       a=t;
223     }
224     a=add(a,olda);
225     b=add(b,oldb);
226     c=add(c,oldc);
227     d=add(d,oldd);
228     e=add(e,olde);
229   }
230     SHA1Value=SHA1hex(a)+SHA1hex(b)+SHA1hex(c)+SHA1hex(d)+SHA1hex(e);
231    return SHA1Value.toUpperCase();
232 }
233
234 </script>

ASP call SDK Share friends on wechat 、 More articles about circle of friends

  1. UC and QQ Two mainstream browsers * Click to trigger wechat to share or send to friends ( Reprint )

    Reprint ( Statement : For learning purposes only ) /** * The main function of this plug-in is UC and QQ Two mainstream browsers * It triggers the function of wechat to share or send to friends * In the process of coding Reference resources : * http://mjs.sinaimg ...

  2. iOS - Social sharing - Wechat sharing , Share with friends

    I just did text and picture sharing 1. TARGETS - Info - URL Types identifier -> weixin URL Schemes ->   application id 2. stay AppD ...

  3. About wechat sharing to the circle of friends (Thinkphp Under the framework )

    PHP part Extension class code section : <?php namespace Think; class JsSdk {       private $appId;       private $appSecre ...

  4. About wechat sharing to the circle of friends (Thinkphp-tp3.2 Under the framework )

    PHP part Extension class code section : <?php namespace Think; class JsSdk { private $appId; private $appSecret; public $d ...

  5. When sharing with friends on wechat , Mobile phone code scanning report config:invalid signature, Normal problems after sharing , yes url problem

    Follow the steps below except ACCESS_TOKEN No cache, everything else is OK If it is invalid signature Signature error . It is recommended to check in the following order : 1. Make sure the signature algorithm is correct , You can use http://mp.weixi ...

  6. vue Sharing the circle of friends in the project , Call wechat interface

    Although wechat provides jssdk, It doesn't mean you can click the button to share with your friends , It needs to be shared in the upper right corner of wechat's browser . Mobile browsers need browsers to support the sharing mechanism of sharing to the circle of friends . WeChat jssdk Address : https://mp.wei ...

  7. Android Share wechat friends Circle of friends

    Third-party applications , You can call wechat to share , Put the link , written words , Various media, Share with wechat friends or wechat circle of friends , step : package com.edaixi.utils; import android.content.Co ...

  8. Swift - Send a message ( Text , picture , Documents, etc. ) To wechat friends or share with friends

    By calling the API Interface , We can easily send messages to wechat friends in the application , Or share it with friends . On wechat development platform (https://open.weixin.qq.com) in , Detailed documentation and examples are provided . But because of ...

  9. UC browser Share with friends and wechat friends classification : JavaScript 2015-04-28 14:45 615 Human reading Comment on (1) Collection

    With a cell phone UC The browser visits Sina Weibo , You'll notice that there are two share buttons : In the mobile browser , Click the share button , You can start the wechat client and share it with wechat . Studied its source code , There is such a js:http://mjs.sinaim ...

  10. UC browser Share with friends and wechat friends

    With a cell phone UC The browser visits Sina Weibo , You'll notice that there are two share buttons : In the mobile browser , Click the share button , You can start the wechat client and share it with wechat . Studied its source code , There is such a js:http://mjs.sinaim ...

Random recommendation

  1. LA 5846 ( Count ) Neon Sign

    On the other hand , Count the number of non monochromatic triangles . If you start from one point, two sides of different colors , Then these three points must form a non monochromatic triangle . Enumerate a vertex , Count the number of red edges from this point a[i] And the number of blue edges n - 1 - a[i], ...

  2. [HDU 5029] Relief grain

    Relief grain Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 100000/100000 K (Java/Others)T ...

  3. 【 translate 】4 One thing you need to know Asset Catalog The secret of

    This paper is written by CocoaChina translator  @ Haw and haw   translate , author :Hector Matos original text :4 XCODE ASSET CATALOG SECRETS YOU NEED TO KNOW A nightmare Imagine you're doing ...

  4. Linux id command - Show users id And groups id Information

    To log on to a computer , We need a user name . A user name is an identity that can be recognized by a computer . Based on this , The computer will apply a series of rules to the login person who uses this user name . stay Linux Under the system , We can use  id  command . What is? id command ...

  5. Performance test monitoring :Jmeter +InfluxDB +collectd +Grafana

    virtual machine ip 192.168.180.128 Influxdb Influxdb It's an open source distributed timing . Time and metrics database , Use go Language writing , No external dependence . It has three characteristics : Timing (Time Series ...

  6. POJ 2352 Tree array

    Learn from : Links and Baidu Encyclopedia as well as :https://www.bilibili.com/video/av18735440?from=search&seid=363548948825132979 understand ...

  7. 2019-03-08-day007- Depth copy

    01 Yesterday's review is in-between id Are they the same? == Whether the values on both sides are equal id Get the memory address of the object Code block : A file , Interactive command line : A line is a block of code . In the same code block : String caching mechanism , Resident machine ...

  8. centos upgrade sqlite3

    1.yum remove sqlite3 2. download : wget -O sqlite-autoconf-.tar.gz https://www.sqlite.org/2019/sqlite-autoc ...

  9. MySQL 5.7 New backup tools mysqlpump Instructions - Operation and maintenance summary

    I have described in detail before Mysqldump Backup tools use , Say below MySQL5.7 After that, the newly added backup tools mysqlpump.mysqlpump yes mysqldump A derivative of ,mysqldump I won't say much about the backup function ...

  10. 2016011998+sw

    Coding.net Original warehouse address :https://git.coding.net/laolaf/sw.git Catalog 1 Demand analysis 2 Functional design 3 Design implementation 4 Algorithm details 5 test run 6 Satisfaction code 1 ...