Przeglądaj źródła

增加全局log返回

增加全局log返回
changtuiqie 7 lat temu
rodzic
commit
04a9f5e10c

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


+ 70 - 113
IPADDemo/FormDemo.Designer.cs

@@ -34,6 +34,10 @@
             this.label1 = new System.Windows.Forms.Label();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage1 = new System.Windows.Forms.TabPage();
+            this.button49 = new System.Windows.Forms.Button();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.textBox3 = new System.Windows.Forms.TextBox();
+            this.label57 = new System.Windows.Forms.Label();
             this.button24 = new System.Windows.Forms.Button();
             this.txt_linkImgUrl = new System.Windows.Forms.TextBox();
             this.label28 = new System.Windows.Forms.Label();
@@ -57,7 +61,6 @@
             this.label2 = new System.Windows.Forms.Label();
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.button48 = new System.Windows.Forms.Button();
-            this.txt_snsLog = new System.Windows.Forms.TextBox();
             this.txt_snsContext = new System.Windows.Forms.TextBox();
             this.label40 = new System.Windows.Forms.Label();
             this.button34 = new System.Windows.Forms.Button();
@@ -133,7 +136,6 @@
             this.label19 = new System.Windows.Forms.Label();
             this.txt_v1 = new System.Windows.Forms.TextBox();
             this.label18 = new System.Windows.Forms.Label();
-            this.txt_positionReturn = new System.Windows.Forms.TextBox();
             this.button15 = new System.Windows.Forms.Button();
             this.txt_Lng = new System.Windows.Forms.TextBox();
             this.label17 = new System.Windows.Forms.Label();
@@ -150,7 +152,6 @@
             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();
             this.button21 = new System.Windows.Forms.Button();
             this.txt_gzhid = new System.Windows.Forms.TextBox();
             this.label22 = new System.Windows.Forms.Label();
@@ -168,10 +169,8 @@
             this.label31 = new System.Windows.Forms.Label();
             this.txt_labelWxid = new System.Windows.Forms.TextBox();
             this.label30 = new System.Windows.Forms.Label();
-            this.txt_labelList = new System.Windows.Forms.TextBox();
             this.button25 = new System.Windows.Forms.Button();
             this.tabPage10 = new System.Windows.Forms.TabPage();
-            this.txt_favItem = new System.Windows.Forms.TextBox();
             this.txt_favId = new System.Windows.Forms.TextBox();
             this.label36 = new System.Windows.Forms.Label();
             this.button31 = new System.Windows.Forms.Button();
@@ -205,13 +204,10 @@
             this.txt_orderUrl = new System.Windows.Forms.TextBox();
             this.label46 = new System.Windows.Forms.Label();
             this.label45 = new System.Windows.Forms.Label();
-            this.txt_qrcodeLog = new System.Windows.Forms.TextBox();
             this.button42 = new System.Windows.Forms.Button();
             this.button14 = new System.Windows.Forms.Button();
-            this.button49 = new System.Windows.Forms.Button();
-            this.textBox2 = new System.Windows.Forms.TextBox();
-            this.textBox3 = new System.Windows.Forms.TextBox();
-            this.label57 = new System.Windows.Forms.Label();
+            this.txt_syslog = new System.Windows.Forms.TextBox();
+            this.label56 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
@@ -309,6 +305,40 @@
             this.tabPage1.Text = "消息模块";
             this.tabPage1.UseVisualStyleBackColor = true;
             // 
+            // button49
+            // 
+            this.button49.Location = new System.Drawing.Point(654, 59);
+            this.button49.Name = "button49";
+            this.button49.Size = new System.Drawing.Size(86, 28);
+            this.button49.TabIndex = 25;
+            this.button49.Text = "群发";
+            this.button49.UseVisualStyleBackColor = true;
+            this.button49.Click += new System.EventHandler(this.button49_Click);
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(442, 59);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(206, 25);
+            this.textBox2.TabIndex = 24;
+            // 
+            // textBox3
+            // 
+            this.textBox3.Location = new System.Drawing.Point(442, 13);
+            this.textBox3.Name = "textBox3";
+            this.textBox3.Size = new System.Drawing.Size(206, 25);
+            this.textBox3.TabIndex = 22;
+            this.textBox3.Text = "[\"AB1\",\"AC2\",\"AD3\"]";
+            // 
+            // label57
+            // 
+            this.label57.AutoSize = true;
+            this.label57.Location = new System.Drawing.Point(338, 18);
+            this.label57.Name = "label57";
+            this.label57.Size = new System.Drawing.Size(54, 15);
+            this.label57.TabIndex = 21;
+            this.label57.Text = "wxid:";
+            // 
             // button24
             // 
             this.button24.Location = new System.Drawing.Point(51, 341);
@@ -496,7 +526,6 @@
             // tabPage2
             // 
             this.tabPage2.Controls.Add(this.button48);
-            this.tabPage2.Controls.Add(this.txt_snsLog);
             this.tabPage2.Controls.Add(this.txt_snsContext);
             this.tabPage2.Controls.Add(this.label40);
             this.tabPage2.Controls.Add(this.button34);
@@ -532,14 +561,6 @@
             this.button48.UseVisualStyleBackColor = true;
             this.button48.Click += new System.EventHandler(this.button48_Click);
             // 
-            // txt_snsLog
-            // 
-            this.txt_snsLog.Location = new System.Drawing.Point(275, 210);
-            this.txt_snsLog.Multiline = true;
-            this.txt_snsLog.Name = "txt_snsLog";
-            this.txt_snsLog.Size = new System.Drawing.Size(484, 135);
-            this.txt_snsLog.TabIndex = 17;
-            // 
             // txt_snsContext
             // 
             this.txt_snsContext.Location = new System.Drawing.Point(489, 151);
@@ -1151,7 +1172,6 @@
             this.tabPage6.Controls.Add(this.label19);
             this.tabPage6.Controls.Add(this.txt_v1);
             this.tabPage6.Controls.Add(this.label18);
-            this.tabPage6.Controls.Add(this.txt_positionReturn);
             this.tabPage6.Controls.Add(this.button15);
             this.tabPage6.Controls.Add(this.txt_Lng);
             this.tabPage6.Controls.Add(this.label17);
@@ -1167,7 +1187,7 @@
             // 
             // button47
             // 
-            this.button47.Location = new System.Drawing.Point(371, 301);
+            this.button47.Location = new System.Drawing.Point(371, 228);
             this.button47.Name = "button47";
             this.button47.Size = new System.Drawing.Size(106, 27);
             this.button47.TabIndex = 17;
@@ -1177,7 +1197,7 @@
             // 
             // txt_addUserInfo
             // 
-            this.txt_addUserInfo.Location = new System.Drawing.Point(167, 303);
+            this.txt_addUserInfo.Location = new System.Drawing.Point(167, 230);
             this.txt_addUserInfo.Name = "txt_addUserInfo";
             this.txt_addUserInfo.Size = new System.Drawing.Size(179, 25);
             this.txt_addUserInfo.TabIndex = 16;
@@ -1185,7 +1205,7 @@
             // label55
             // 
             this.label55.AutoSize = true;
-            this.label55.Location = new System.Drawing.Point(33, 306);
+            this.label55.Location = new System.Drawing.Point(33, 233);
             this.label55.Name = "label55";
             this.label55.Size = new System.Drawing.Size(136, 15);
             this.label55.TabIndex = 15;
@@ -1193,7 +1213,7 @@
             // 
             // button16
             // 
-            this.button16.Location = new System.Drawing.Point(643, 295);
+            this.button16.Location = new System.Drawing.Point(643, 222);
             this.button16.Name = "button16";
             this.button16.Size = new System.Drawing.Size(90, 41);
             this.button16.TabIndex = 14;
@@ -1204,7 +1224,7 @@
             // label21
             // 
             this.label21.AutoSize = true;
-            this.label21.Location = new System.Drawing.Point(353, 253);
+            this.label21.Location = new System.Drawing.Point(353, 180);
             this.label21.Name = "label21";
             this.label21.Size = new System.Drawing.Size(82, 15);
             this.label21.TabIndex = 13;
@@ -1229,14 +1249,14 @@
             "22-通过摇一摇打招呼方式--可以",
             "25-通过漂流瓶---no",
             "30-通过二维码方式--可以"});
-            this.cb_addtype.Location = new System.Drawing.Point(441, 252);
+            this.cb_addtype.Location = new System.Drawing.Point(441, 179);
             this.cb_addtype.Name = "cb_addtype";
             this.cb_addtype.Size = new System.Drawing.Size(274, 23);
             this.cb_addtype.TabIndex = 12;
             // 
             // txt_hellotext
             // 
-            this.txt_hellotext.Location = new System.Drawing.Point(92, 250);
+            this.txt_hellotext.Location = new System.Drawing.Point(92, 177);
             this.txt_hellotext.Name = "txt_hellotext";
             this.txt_hellotext.Size = new System.Drawing.Size(219, 25);
             this.txt_hellotext.TabIndex = 11;
@@ -1244,7 +1264,7 @@
             // label20
             // 
             this.label20.AutoSize = true;
-            this.label20.Location = new System.Drawing.Point(33, 253);
+            this.label20.Location = new System.Drawing.Point(33, 180);
             this.label20.Name = "label20";
             this.label20.Size = new System.Drawing.Size(67, 15);
             this.label20.TabIndex = 10;
@@ -1252,7 +1272,7 @@
             // 
             // txt_v2
             // 
-            this.txt_v2.Location = new System.Drawing.Point(92, 210);
+            this.txt_v2.Location = new System.Drawing.Point(92, 137);
             this.txt_v2.Name = "txt_v2";
             this.txt_v2.Size = new System.Drawing.Size(653, 25);
             this.txt_v2.TabIndex = 9;
@@ -1260,7 +1280,7 @@
             // label19
             // 
             this.label19.AutoSize = true;
-            this.label19.Location = new System.Drawing.Point(33, 213);
+            this.label19.Location = new System.Drawing.Point(33, 140);
             this.label19.Name = "label19";
             this.label19.Size = new System.Drawing.Size(38, 15);
             this.label19.TabIndex = 8;
@@ -1268,7 +1288,7 @@
             // 
             // txt_v1
             // 
-            this.txt_v1.Location = new System.Drawing.Point(92, 175);
+            this.txt_v1.Location = new System.Drawing.Point(92, 102);
             this.txt_v1.Name = "txt_v1";
             this.txt_v1.Size = new System.Drawing.Size(653, 25);
             this.txt_v1.TabIndex = 7;
@@ -1276,20 +1296,12 @@
             // label18
             // 
             this.label18.AutoSize = true;
-            this.label18.Location = new System.Drawing.Point(33, 178);
+            this.label18.Location = new System.Drawing.Point(33, 105);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(38, 15);
             this.label18.TabIndex = 6;
             this.label18.Text = "v1:";
             // 
-            // txt_positionReturn
-            // 
-            this.txt_positionReturn.Location = new System.Drawing.Point(33, 60);
-            this.txt_positionReturn.Multiline = true;
-            this.txt_positionReturn.Name = "txt_positionReturn";
-            this.txt_positionReturn.Size = new System.Drawing.Size(712, 100);
-            this.txt_positionReturn.TabIndex = 5;
-            // 
             // button15
             // 
             this.button15.Location = new System.Drawing.Point(441, 18);
@@ -1346,7 +1358,6 @@
             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);
             this.tabPage8.Controls.Add(this.button21);
             this.tabPage8.Controls.Add(this.txt_gzhid);
             this.tabPage8.Controls.Add(this.label22);
@@ -1445,14 +1456,6 @@
             this.button22.UseVisualStyleBackColor = true;
             this.button22.Click += new System.EventHandler(this.button22_Click);
             // 
-            // txt_gzhlog
-            // 
-            this.txt_gzhlog.Location = new System.Drawing.Point(6, 257);
-            this.txt_gzhlog.Multiline = true;
-            this.txt_gzhlog.Name = "txt_gzhlog";
-            this.txt_gzhlog.Size = new System.Drawing.Size(753, 133);
-            this.txt_gzhlog.TabIndex = 3;
-            // 
             // button21
             // 
             this.button21.Location = new System.Drawing.Point(422, 15);
@@ -1511,7 +1514,6 @@
             this.tabPage9.Controls.Add(this.label31);
             this.tabPage9.Controls.Add(this.txt_labelWxid);
             this.tabPage9.Controls.Add(this.label30);
-            this.tabPage9.Controls.Add(this.txt_labelList);
             this.tabPage9.Controls.Add(this.button25);
             this.tabPage9.Location = new System.Drawing.Point(4, 25);
             this.tabPage9.Name = "tabPage9";
@@ -1615,14 +1617,6 @@
             this.label30.TabIndex = 2;
             this.label30.Text = "wxid:";
             // 
-            // txt_labelList
-            // 
-            this.txt_labelList.Location = new System.Drawing.Point(24, 68);
-            this.txt_labelList.Multiline = true;
-            this.txt_labelList.Name = "txt_labelList";
-            this.txt_labelList.Size = new System.Drawing.Size(198, 307);
-            this.txt_labelList.TabIndex = 1;
-            // 
             // button25
             // 
             this.button25.Location = new System.Drawing.Point(24, 21);
@@ -1635,7 +1629,6 @@
             // 
             // tabPage10
             // 
-            this.tabPage10.Controls.Add(this.txt_favItem);
             this.tabPage10.Controls.Add(this.txt_favId);
             this.tabPage10.Controls.Add(this.label36);
             this.tabPage10.Controls.Add(this.button31);
@@ -1653,14 +1646,6 @@
             this.tabPage10.Text = "收藏";
             this.tabPage10.UseVisualStyleBackColor = true;
             // 
-            // txt_favItem
-            // 
-            this.txt_favItem.Location = new System.Drawing.Point(6, 175);
-            this.txt_favItem.Multiline = true;
-            this.txt_favItem.Name = "txt_favItem";
-            this.txt_favItem.Size = new System.Drawing.Size(753, 212);
-            this.txt_favItem.TabIndex = 9;
-            // 
             // txt_favId
             // 
             this.txt_favId.Location = new System.Drawing.Point(233, 121);
@@ -1921,7 +1906,6 @@
             this.tabPage12.Controls.Add(this.txt_orderUrl);
             this.tabPage12.Controls.Add(this.label46);
             this.tabPage12.Controls.Add(this.label45);
-            this.tabPage12.Controls.Add(this.txt_qrcodeLog);
             this.tabPage12.Controls.Add(this.button42);
             this.tabPage12.Location = new System.Drawing.Point(4, 25);
             this.tabPage12.Name = "tabPage12";
@@ -1976,14 +1960,6 @@
             this.label45.TabIndex = 2;
             this.label45.Text = "使用账号密码+62登录后 可以打开pc或web端的二维码获取URL后登录其他终端";
             // 
-            // txt_qrcodeLog
-            // 
-            this.txt_qrcodeLog.Location = new System.Drawing.Point(7, 198);
-            this.txt_qrcodeLog.Multiline = true;
-            this.txt_qrcodeLog.Name = "txt_qrcodeLog";
-            this.txt_qrcodeLog.Size = new System.Drawing.Size(752, 192);
-            this.txt_qrcodeLog.TabIndex = 1;
-            // 
             // button42
             // 
             this.button42.Location = new System.Drawing.Point(21, 16);
@@ -2004,45 +1980,30 @@
             this.button14.UseVisualStyleBackColor = true;
             this.button14.Click += new System.EventHandler(this.button14_Click);
             // 
-            // button49
-            // 
-            this.button49.Location = new System.Drawing.Point(654, 59);
-            this.button49.Name = "button49";
-            this.button49.Size = new System.Drawing.Size(86, 28);
-            this.button49.TabIndex = 25;
-            this.button49.Text = "群发";
-            this.button49.UseVisualStyleBackColor = true;
-            this.button49.Click += new System.EventHandler(this.button49_Click);
-            // 
-            // textBox2
+            // txt_syslog
             // 
-            this.textBox2.Location = new System.Drawing.Point(442, 59);
-            this.textBox2.Name = "textBox2";
-            this.textBox2.Size = new System.Drawing.Size(206, 25);
-            this.textBox2.TabIndex = 24;
+            this.txt_syslog.Location = new System.Drawing.Point(15, 479);
+            this.txt_syslog.Multiline = true;
+            this.txt_syslog.Name = "txt_syslog";
+            this.txt_syslog.Size = new System.Drawing.Size(978, 143);
+            this.txt_syslog.TabIndex = 5;
             // 
-            // textBox3
+            // label56
             // 
-            this.textBox3.Location = new System.Drawing.Point(442, 13);
-            this.textBox3.Name = "textBox3";
-            this.textBox3.Size = new System.Drawing.Size(206, 25);
-            this.textBox3.TabIndex = 22;
-            this.textBox3.Text = "[\"AB1\",\"AC2\",\"AD3\"]";
-            // 
-            // label57
-            // 
-            this.label57.AutoSize = true;
-            this.label57.Location = new System.Drawing.Point(338, 18);
-            this.label57.Name = "label57";
-            this.label57.Size = new System.Drawing.Size(54, 15);
-            this.label57.TabIndex = 21;
-            this.label57.Text = "wxid:";
+            this.label56.AutoSize = true;
+            this.label56.Location = new System.Drawing.Point(12, 450);
+            this.label56.Name = "label56";
+            this.label56.Size = new System.Drawing.Size(67, 15);
+            this.label56.TabIndex = 6;
+            this.label56.Text = "返回值:";
             // 
             // FormDemo
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1009, 454);
+            this.ClientSize = new System.Drawing.Size(1009, 634);
+            this.Controls.Add(this.label56);
+            this.Controls.Add(this.txt_syslog);
             this.Controls.Add(this.button14);
             this.Controls.Add(this.tabControl1);
             this.Controls.Add(this.label1);
@@ -2144,7 +2105,6 @@
         private System.Windows.Forms.Label label16;
         private System.Windows.Forms.Button button15;
         private System.Windows.Forms.TextBox txt_Lng;
-        private System.Windows.Forms.TextBox txt_positionReturn;
         private System.Windows.Forms.TextBox txt_v2;
         private System.Windows.Forms.Label label19;
         private System.Windows.Forms.TextBox txt_v1;
@@ -2162,7 +2122,6 @@
         private System.Windows.Forms.Label label22;
         private System.Windows.Forms.Button button21;
         private System.Windows.Forms.TextBox txt_gzhid;
-        private System.Windows.Forms.TextBox txt_gzhlog;
         private System.Windows.Forms.Button button22;
         private System.Windows.Forms.ListBox lb_gzh;
         private System.Windows.Forms.Button button23;
@@ -2184,7 +2143,6 @@
         private System.Windows.Forms.Label label29;
         private System.Windows.Forms.TabPage tabPage9;
         private System.Windows.Forms.Button button25;
-        private System.Windows.Forms.TextBox txt_labelList;
         private System.Windows.Forms.Button button26;
         private System.Windows.Forms.TextBox txt_labelId;
         private System.Windows.Forms.Label label31;
@@ -2206,7 +2164,6 @@
         private System.Windows.Forms.Button button31;
         private System.Windows.Forms.TextBox txt_favId;
         private System.Windows.Forms.Label label36;
-        private System.Windows.Forms.TextBox txt_favItem;
         private System.Windows.Forms.TextBox txt_snswxid;
         private System.Windows.Forms.Label label37;
         private System.Windows.Forms.Button button32;
@@ -2239,7 +2196,6 @@
         private System.Windows.Forms.TextBox txt_setWxid;
         private System.Windows.Forms.TabPage tabPage12;
         private System.Windows.Forms.Button button42;
-        private System.Windows.Forms.TextBox txt_qrcodeLog;
         private System.Windows.Forms.Button button43;
         private System.Windows.Forms.TextBox txt_orderUrl;
         private System.Windows.Forms.Label label46;
@@ -2248,7 +2204,6 @@
         private System.Windows.Forms.TextBox txt_gzhUrl;
         private System.Windows.Forms.Label label47;
         private System.Windows.Forms.Button button45;
-        private System.Windows.Forms.TextBox txt_snsLog;
         private System.Windows.Forms.Label label51;
         private System.Windows.Forms.Label label50;
         private System.Windows.Forms.TextBox txt_setSex;
@@ -2271,5 +2226,7 @@
         private System.Windows.Forms.TextBox textBox2;
         private System.Windows.Forms.TextBox textBox3;
         private System.Windows.Forms.Label label57;
+        private System.Windows.Forms.TextBox txt_syslog;
+        private System.Windows.Forms.Label label56;
     }
 }

+ 55 - 24
IPADDemo/FormDemo.cs

@@ -79,11 +79,13 @@ namespace IPADDemo
         private void button1_Click(object sender, EventArgs e)
         {
             var res=weChatThread.Wx_SendMsg(txt_msgWxid.Text, txt_msgText.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button49_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_MassMessage(txt_msgWxid.Text, txt_msgText.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button2_Click(object sender, EventArgs e)
@@ -97,13 +99,15 @@ namespace IPADDemo
             if (ofd.ShowDialog() == DialogResult.OK)
             {
                 string FileName = ofd.FileName;
-                weChatThread.Wx_SendImg(txt_msgWxid.Text, FileName);
+                var res = weChatThread.Wx_SendImg(txt_msgWxid.Text, FileName);
+                txt_syslog.Text = res.ConvertToString();
             }
         }
 
         private void button17_Click(object sender, EventArgs e)
         {
-            string str = weChatThread.Wx_SendVoice(txt_msgWxid.Text, "测试音频1.silk", 1);
+            string res = weChatThread.Wx_SendVoice(txt_msgWxid.Text, "测试音频1.silk", 1);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button23_Click(object sender, EventArgs e)
@@ -123,7 +127,8 @@ namespace IPADDemo
                 {
                     return;
                 }
-                string str = weChatThread.Wx_SendVoice(txt_msgWxid.Text, silkStr, 1);
+                string res = weChatThread.Wx_SendVoice(txt_msgWxid.Text, silkStr, 1);
+                txt_syslog.Text = res.ConvertToString();
             });          
         }
 
@@ -136,12 +141,14 @@ namespace IPADDemo
                    Replace("$des$", txt_linkDesc.Text).
                     Replace("$url$", txt_linkUrl.Text).
                      Replace("$thumburl$", txt_linkImgUrl.Text);
-            weChatThread.Wx_SendAppMsg(txt_msgWxid.Text, xml);
+            var res = weChatThread.Wx_SendAppMsg(txt_msgWxid.Text, xml);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button3_Click(object sender, EventArgs e)
         {
-            weChatThread.Wx_SendMoment(txt_snsText.Text);
+            var res=weChatThread.Wx_SendMoment(txt_snsText.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button4_Click(object sender, EventArgs e)
@@ -151,7 +158,8 @@ namespace IPADDemo
                 imgPath.Add(ImgToBase64String(a.ToString()));
                 //imgPath.Add(FileToBase64String(a.ToString()));
             }
-            weChatThread.Wx_SendMoment(txt_snsText.Text, imgPath);
+            var res=weChatThread.Wx_SendMoment(txt_snsText.Text, imgPath);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private string FileToBase64String(string path) {
@@ -206,41 +214,49 @@ namespace IPADDemo
         private void button6_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_CreateChatRoom(txt_GroupUsers.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button39_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_GetChatRoomMember(txt_groupwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button7_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_AddChatRoomMember(txt_groupwxid.Text,txt_groupuserwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button38_Click(object sender, EventArgs e)
         {
            var res=weChatThread.Wx_InviteChatRoomMember(txt_groupwxid.Text, txt_groupuserwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button8_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_DeleteChatRoomMember(txt_groupwxid.Text, txt_groupuserwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button9_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SetChatroomName(txt_groupwxid.Text, txt_groupname.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button10_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SetChatroomAnnouncement(txt_groupwxid.Text, txt_groupgg.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button11_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_QuitChatRoom(txt_groupwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button12_Click(object sender, EventArgs e)
@@ -279,118 +295,133 @@ namespace IPADDemo
 
         private void button15_Click(object sender, EventArgs e)
         {
-           txt_positionReturn.Text= weChatThread.Wx_GetPeopleNearby(float.Parse(txt_Lat.Text), float.Parse(txt_Lng.Text));
+            var res = weChatThread.Wx_GetPeopleNearby(float.Parse(txt_Lat.Text), float.Parse(txt_Lng.Text));
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button16_Click(object sender, EventArgs e)
         {
             string [] types= cb_addtype.Text.Split('-');
             int type = int.Parse(types[0]);
-            string result = weChatThread.Wx_AddUser(txt_v1.Text, txt_v2.Text, type, txt_hellotext.Text);
+            string res = weChatThread.Wx_AddUser(txt_v1.Text, txt_v2.Text, type, txt_hellotext.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button21_Click(object sender, EventArgs e)
         {
-            string result = weChatThread.Wx_AddUser(txt_gzhid.Text, "", 0, "");
+            string res = weChatThread.Wx_AddUser(txt_gzhid.Text, "", 0, "");
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button22_Click(object sender, EventArgs e)
         {
-            txt_gzhlog.Text = weChatThread.GetSubscriptionInfo(txt_gzhid.Text);
+            var res = weChatThread.GetSubscriptionInfo(txt_gzhid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         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);
+            var res = weChatThread.Wx_SubscriptionCommand(txt_gzhid.Text, uint.Parse(txt_gzhUin.Text), txt_gzhKey.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button45_Click(object sender, EventArgs e)
         {
-            txt_gzhlog.Text = weChatThread.Wx_RequestUrl(txt_gzhUrl.Text, txt_gzhUin.Text, txt_gzhKey.Text);
+            var res = weChatThread.Wx_RequestUrl(txt_gzhUrl.Text, txt_gzhUin.Text, txt_gzhKey.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button25_Click(object sender, EventArgs e)
         {
-            string str = weChatThread.Wx_GetContactLabelList();
-            txt_labelList.Text = str;
+            string res = weChatThread.Wx_GetContactLabelList();
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button26_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SetContactLabel(txt_labelWxid.Text, txt_labelId.Text);
+            txt_syslog.Text = res.ConvertToString();
 
         }
 
         private void button27_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_AddContactLabel(txt_labelName.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button28_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_DeleteContactLabel(txt_labelId1.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button29_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_FavSync(txt_favKey.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button30_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_FavAddItem(Encoding.Default.GetString(Encoding.UTF8.GetBytes(txt_favObject.Text)));
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button31_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_FavGetItem(txt_favId.Text);
-            txt_favItem.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button32_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SnsUserPage(txt_snswxid.Text,"");
-            txt_snsLog.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button33_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SnsObjectDetail(txt_snsId.Text);
-            txt_snsLog.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button34_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SnsComment(txt_snsId.Text, Encoding.Default.GetString(Encoding.UTF8.GetBytes(txt_snsContext.Text)), txt_snsPlId.Text.ConvertToInt32());
-            txt_snsLog.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
 
         private void button48_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SnsTimeline("");
-            txt_snsLog.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
 
         private void button35_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_GetContact(txt_friendwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button36_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SetUserRemark(txt_friendwxid.Text, txt_friendRemark.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button37_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_DeleteUser(txt_friendwxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button41_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SetWeChatID(txt_setWxid.Text);
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button42_Click(object sender, EventArgs e)
@@ -405,32 +436,32 @@ namespace IPADDemo
             {
                 string FileName = ofd.FileName;
                 var res = weChatThread.Wx_QRCodeDecode(FileName);
-                txt_qrcodeLog.Text = res.ConvertToString();
+                txt_syslog.Text = res.ConvertToString();
             }
         }
 
         private void button43_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_ExtDeviceLoginGet(txt_orderUrl.Text);
-            txt_qrcodeLog.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button44_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_ExtDeviceLoginOK(txt_orderUrl.Text);
-            txt_qrcodeLog.Text = res.ConvertToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button46_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SetUserInfo(txt_setNickName.Text,txt_setSign.Text,txt_setSex.Text.ConvertToInt32(),txt_setCountry.Text,txt_setProvincia.Text,txt_setCity.Text);
-
+            txt_syslog.Text = res.ConvertToString();
         }
 
         private void button47_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_SearchContact(txt_addUserInfo.Text);
-            txt_positionReturn.Text = res.ToString();
+            txt_syslog.Text = res.ConvertToString();
         }
 
        

+ 17 - 18
IPADDemo/WeChat/XzyWeChatThread.cs

@@ -730,27 +730,23 @@ namespace IPADDemo.WeChat
         /// </summary>
         /// <param name="wxid"></param>
         /// <param name="imgpath"></param>
-        public unsafe void Wx_SendImg(string wxid, string imgpath)
+        public unsafe string Wx_SendImg(string wxid, string imgpath)
         {
             WxDelegate.show(string.Format("发送图片 :{0}", imgpath));
 
             fixed (int* WxUser1 = &pointerWxUser, imptr1 = &wx_imptr)
             {
-                try
-                {
-                    Image _image = Image.FromStream(WebRequest.Create(imgpath).GetResponse().GetResponseStream());
-                    //把文件读取到字节数组
-                    byte[] data = this.ImageToBytes(_image);
-                    if (data.Length > 0)
-                    {
-                        XzyWxApis.WXSendImage(pointerWxUser, wxid, data, data.Length, (int)imptr1);
-                        var datas = MarshalNativeToManaged((IntPtr)wx_imptr);
-                        var str = datas.ToString();
-                        Wx_ReleaseEX(ref wx_imptr);
-                    }
-                    _image = null;
-                }
-                catch { }
+
+                Image _image = Image.FromStream(WebRequest.Create(imgpath).GetResponse().GetResponseStream());
+                //把文件读取到字节数组
+                byte[] data = this.ImageToBytes(_image);
+
+                XzyWxApis.WXSendImage(pointerWxUser, wxid, data, data.Length, (int)imptr1);
+                var datas = MarshalNativeToManaged((IntPtr)wx_imptr);
+                var str = datas.ToString();
+                Wx_ReleaseEX(ref wx_imptr);
+                _image = null;
+                return str;
             }
         }
 
@@ -1445,7 +1441,7 @@ namespace IPADDemo.WeChat
         /// </summary>
         /// <param name="wxid"></param>
         /// <param name="content"></param>
-        public unsafe void Wx_SendMoment(string content, List<string> imagelist)
+        public unsafe string Wx_SendMoment(string content, List<string> imagelist)
         {
             fixed (int* WxUser1 = &pointerWxUser, msgptr1 = &msgPtr)
             {
@@ -1467,11 +1463,13 @@ namespace IPADDemo.WeChat
                     var datas = MarshalNativeToManaged((IntPtr)msgPtr);
                     result = datas.ToString();
                     Wx_ReleaseEX(ref msgPtr);
+                    return result;
                 }
+                return "参数错误";
             }
         }
 
-        public unsafe void Wx_SendMoment(string content)
+        public unsafe string Wx_SendMoment(string content)
         {
             var result = "";
             fixed (int* WxUser1 = &pointerWxUser, msgptr1 = &msgPtr)
@@ -1480,6 +1478,7 @@ namespace IPADDemo.WeChat
                 var datas = MarshalNativeToManaged((IntPtr)msgPtr);
                 result = datas.ToString();
                 Wx_ReleaseEX(ref msgPtr);
+                return result;
             }
         }
 

BIN
IPADDemo/bin/Debug/IPADDemo.exe


BIN
IPADDemo/bin/Debug/IPADDemo.pdb


BIN
IPADDemo/obj/Debug/IPADDemo.csproj.GenerateResource.cache


BIN
IPADDemo/obj/Debug/IPADDemo.exe


BIN
IPADDemo/obj/Debug/IPADDemo.pdb