Forráskód Böngészése

执行公众号菜单

执行公众号菜单
changtuiqie 7 éve
szülő
commit
e5cf489032

BIN
.vs/Ipad/v15/.suo


BIN
.vs/Ipad/v15/Server/sqlite3/storage.ide


BIN
.vs/Ipad/v15/Server/sqlite3/storage.ide-shm


BIN
.vs/Ipad/v15/Server/sqlite3/storage.ide-wal


+ 79 - 22
IPADDemo/FormDemo.Designer.cs

@@ -84,6 +84,8 @@
             this.lb_friend = new System.Windows.Forms.ListBox();
             this.label5 = new System.Windows.Forms.Label();
             this.tabPage4 = new System.Windows.Forms.TabPage();
+            this.button39 = new System.Windows.Forms.Button();
+            this.button38 = new System.Windows.Forms.Button();
             this.lb_group = new System.Windows.Forms.ListBox();
             this.label29 = new System.Windows.Forms.Label();
             this.button11 = new System.Windows.Forms.Button();
@@ -133,6 +135,11 @@
             this.txt_Lat = new System.Windows.Forms.TextBox();
             this.label16 = new System.Windows.Forms.Label();
             this.tabPage8 = new System.Windows.Forms.TabPage();
+            this.button40 = new System.Windows.Forms.Button();
+            this.txt_gzhKey = new System.Windows.Forms.TextBox();
+            this.label43 = new System.Windows.Forms.Label();
+            this.txt_gzhUin = new System.Windows.Forms.TextBox();
+            this.label42 = new System.Windows.Forms.Label();
             this.lb_gzh = new System.Windows.Forms.ListBox();
             this.button22 = new System.Windows.Forms.Button();
             this.txt_gzhlog = new System.Windows.Forms.TextBox();
@@ -167,8 +174,6 @@
             this.label34 = new System.Windows.Forms.Label();
             this.button29 = new System.Windows.Forms.Button();
             this.button14 = new System.Windows.Forms.Button();
-            this.button38 = new System.Windows.Forms.Button();
-            this.button39 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
@@ -748,6 +753,26 @@
             this.tabPage4.Text = "群模块";
             this.tabPage4.UseVisualStyleBackColor = true;
             // 
+            // button39
+            // 
+            this.button39.Location = new System.Drawing.Point(445, 67);
+            this.button39.Name = "button39";
+            this.button39.Size = new System.Drawing.Size(148, 25);
+            this.button39.TabIndex = 20;
+            this.button39.Text = "获取群成员资料";
+            this.button39.UseVisualStyleBackColor = true;
+            this.button39.Click += new System.EventHandler(this.button39_Click);
+            // 
+            // button38
+            // 
+            this.button38.Location = new System.Drawing.Point(393, 108);
+            this.button38.Name = "button38";
+            this.button38.Size = new System.Drawing.Size(124, 25);
+            this.button38.TabIndex = 19;
+            this.button38.Text = "邀请群成员";
+            this.button38.UseVisualStyleBackColor = true;
+            this.button38.Click += new System.EventHandler(this.button38_Click);
+            // 
             // lb_group
             // 
             this.lb_group.FormattingEnabled = true;
@@ -1216,6 +1241,11 @@
             // 
             // tabPage8
             // 
+            this.tabPage8.Controls.Add(this.button40);
+            this.tabPage8.Controls.Add(this.txt_gzhKey);
+            this.tabPage8.Controls.Add(this.label43);
+            this.tabPage8.Controls.Add(this.txt_gzhUin);
+            this.tabPage8.Controls.Add(this.label42);
             this.tabPage8.Controls.Add(this.lb_gzh);
             this.tabPage8.Controls.Add(this.button22);
             this.tabPage8.Controls.Add(this.txt_gzhlog);
@@ -1230,6 +1260,48 @@
             this.tabPage8.Text = "公众号";
             this.tabPage8.UseVisualStyleBackColor = true;
             // 
+            // button40
+            // 
+            this.button40.Location = new System.Drawing.Point(375, 154);
+            this.button40.Name = "button40";
+            this.button40.Size = new System.Drawing.Size(138, 39);
+            this.button40.TabIndex = 10;
+            this.button40.Text = "执行公众号菜单";
+            this.button40.UseVisualStyleBackColor = true;
+            this.button40.Click += new System.EventHandler(this.button40_Click);
+            // 
+            // txt_gzhKey
+            // 
+            this.txt_gzhKey.Location = new System.Drawing.Point(375, 110);
+            this.txt_gzhKey.Name = "txt_gzhKey";
+            this.txt_gzhKey.Size = new System.Drawing.Size(198, 25);
+            this.txt_gzhKey.TabIndex = 9;
+            // 
+            // label43
+            // 
+            this.label43.AutoSize = true;
+            this.label43.Location = new System.Drawing.Point(322, 113);
+            this.label43.Name = "label43";
+            this.label43.Size = new System.Drawing.Size(47, 15);
+            this.label43.TabIndex = 8;
+            this.label43.Text = "key: ";
+            // 
+            // txt_gzhUin
+            // 
+            this.txt_gzhUin.Location = new System.Drawing.Point(375, 62);
+            this.txt_gzhUin.Name = "txt_gzhUin";
+            this.txt_gzhUin.Size = new System.Drawing.Size(198, 25);
+            this.txt_gzhUin.TabIndex = 7;
+            // 
+            // label42
+            // 
+            this.label42.AutoSize = true;
+            this.label42.Location = new System.Drawing.Point(322, 65);
+            this.label42.Name = "label42";
+            this.label42.Size = new System.Drawing.Size(47, 15);
+            this.label42.TabIndex = 6;
+            this.label42.Text = "uin: ";
+            // 
             // lb_gzh
             // 
             this.lb_gzh.FormattingEnabled = true;
@@ -1554,26 +1626,6 @@
             this.button14.UseVisualStyleBackColor = true;
             this.button14.Click += new System.EventHandler(this.button14_Click);
             // 
-            // button38
-            // 
-            this.button38.Location = new System.Drawing.Point(393, 108);
-            this.button38.Name = "button38";
-            this.button38.Size = new System.Drawing.Size(124, 25);
-            this.button38.TabIndex = 19;
-            this.button38.Text = "邀请群成员";
-            this.button38.UseVisualStyleBackColor = true;
-            this.button38.Click += new System.EventHandler(this.button38_Click);
-            // 
-            // button39
-            // 
-            this.button39.Location = new System.Drawing.Point(445, 67);
-            this.button39.Name = "button39";
-            this.button39.Size = new System.Drawing.Size(148, 25);
-            this.button39.TabIndex = 20;
-            this.button39.Text = "获取群成员资料";
-            this.button39.UseVisualStyleBackColor = true;
-            this.button39.Click += new System.EventHandler(this.button39_Click);
-            // 
             // FormDemo
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -1759,5 +1811,10 @@
         private System.Windows.Forms.Button button37;
         private System.Windows.Forms.Button button38;
         private System.Windows.Forms.Button button39;
+        private System.Windows.Forms.TextBox txt_gzhKey;
+        private System.Windows.Forms.Label label43;
+        private System.Windows.Forms.TextBox txt_gzhUin;
+        private System.Windows.Forms.Label label42;
+        private System.Windows.Forms.Button button40;
     }
 }

+ 5 - 1
IPADDemo/FormDemo.cs

@@ -294,6 +294,11 @@ namespace IPADDemo
             txt_gzhlog.Text = weChatThread.GetSubscriptionInfo(txt_gzhid.Text);
         }
 
+        private void button40_Click(object sender, EventArgs e)
+        {
+            txt_gzhlog.Text = weChatThread.Wx_SubscriptionCommand(txt_gzhid.Text, uint.Parse(txt_gzhUin.Text), txt_gzhKey.Text);
+        }
+
         private void button25_Click(object sender, EventArgs e)
         {
             string str = weChatThread.Wx_GetContactLabelList();
@@ -362,6 +367,5 @@ namespace IPADDemo
             var res = weChatThread.Wx_DeleteUser(txt_friendwxid.Text);
         }
 
-        
     }
 }

+ 25 - 0
IPADDemo/WeChat/XzyWeChatThread.cs

@@ -1681,6 +1681,11 @@ namespace IPADDemo.WeChat
             return result;
         }
 
+        /// <summary>
+        /// 获取公众号菜单
+        /// </summary>
+        /// <param name="gzhid"></param>
+        /// <returns></returns>
         public unsafe string GetSubscriptionInfo(string gzhid)
         {
             var result = "";
@@ -1694,6 +1699,26 @@ namespace IPADDemo.WeChat
             return result;
         }
 
+        /// <summary>
+        /// 执行公众号菜单
+        /// </summary>
+        /// <param name="wxid">公众号用户名gh* 开头的</param>
+        /// <param name="uin">通过WXGetSubscriptionInfo获取</param>
+        /// <param name="key">通过WXGetSubscriptionInfo获取</param>
+        /// <returns></returns>
+        public unsafe string Wx_SubscriptionCommand(string wxid,uint uin,string key)
+        {
+            var result = "";
+            fixed (int* WxUser1 = &pointerWxUser, msgptr1 = &msgPtr)
+            {
+                XzyWxApis.WXSubscriptionCommand(pointerWxUser, wxid,uin,key ,(int)msgptr1);
+                var datas = MarshalNativeToManaged((IntPtr)msgPtr);
+                result = datas.ToString();
+                Wx_ReleaseEX(ref msgPtr);
+            }
+            return result;
+        }
+
         /// <summary>
         /// 后期所有标签
         /// </summary>

BIN
IPADDemo/bin/Debug/IPADDemo.exe


BIN
IPADDemo/bin/Debug/IPADDemo.pdb


+ 1 - 1
IPADDemo/obj/Debug/IPADDemo.csproj.CoreCompileInputs.cache

@@ -1 +1 @@
-0721e6531c5f4ad1cd20dea4cd6a0ae54826a9f8
+8a3f3b398d58fff56d86e2c33effd1b006c205fd

+ 32 - 0
IPADDemo/obj/Debug/IPADDemo.csproj.FileListAbsolute.txt

@@ -149,3 +149,35 @@ C:\xm\git\Xzy.Mac.WeChat\Xzy.Mac.WeChat\IPADDemo\bin\Debug\FSLib.Network.dll
 C:\xm\git\Xzy.Mac.WeChat\Xzy.Mac.WeChat\IPADDemo\bin\Debug\FSLib.Extension.dll
 C:\xm\git\Xzy.Mac.WeChat\Xzy.Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.exe.config
 C:\xm\git\Xzy.Mac.WeChat\Xzy.Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.csprojAssemblyReference.cache
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\IPADDemo.exe.config
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\IPADDemo.exe
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\IPADDemo.pdb
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\log4net.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\Newtonsoft.Json.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\SuperSocket.ClientEngine.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\SuperSocket.ProtoBase.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Collections.Specialized.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Net.NameResolution.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Net.Security.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Net.Sockets.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Security.Cryptography.Algorithms.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Security.Cryptography.Encoding.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Security.Cryptography.Primitives.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.Security.Cryptography.X509Certificates.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.ValueTuple.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\Xzy.IPAD.Core.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\FSLib.Network.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\FSLib.Extension.dll
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\log4net.xml
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\Newtonsoft.Json.xml
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\SuperSocket.ProtoBase.xml
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\System.ValueTuple.xml
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.csprojAssemblyReference.cache
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.exe.config
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.FormDemo.resources
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.Properties.Resources.resources
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.csproj.GenerateResource.cache
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.csproj.CoreCompileInputs.cache
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.csproj.CopyComplete
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.exe
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.pdb

BIN
IPADDemo/obj/Debug/IPADDemo.csprojAssemblyReference.cache


BIN
IPADDemo/obj/Debug/IPADDemo.exe


BIN
IPADDemo/obj/Debug/IPADDemo.pdb