Browse Source

新增功能

新增获取朋友圈所有列表,和搜索加人
changtuiqie 7 năm trước cách đây
mục cha
commit
fd4a4389f6

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


+ 195 - 147
IPADDemo/FormDemo.Designer.cs

@@ -56,6 +56,8 @@
             this.txt_msgWxid = new System.Windows.Forms.TextBox();
             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();
@@ -119,6 +121,9 @@
             this.txt_loginName = new System.Windows.Forms.TextBox();
             this.label12 = new System.Windows.Forms.Label();
             this.tabPage6 = new System.Windows.Forms.TabPage();
+            this.button47 = new System.Windows.Forms.Button();
+            this.txt_addUserInfo = new System.Windows.Forms.TextBox();
+            this.label55 = new System.Windows.Forms.Label();
             this.button16 = new System.Windows.Forms.Button();
             this.label21 = new System.Windows.Forms.Label();
             this.cb_addtype = new System.Windows.Forms.ComboBox();
@@ -177,6 +182,20 @@
             this.label34 = new System.Windows.Forms.Label();
             this.button29 = new System.Windows.Forms.Button();
             this.tabPage11 = new System.Windows.Forms.TabPage();
+            this.button46 = new System.Windows.Forms.Button();
+            this.label54 = new System.Windows.Forms.Label();
+            this.txt_setCity = new System.Windows.Forms.TextBox();
+            this.label53 = new System.Windows.Forms.Label();
+            this.txt_setProvincia = new System.Windows.Forms.TextBox();
+            this.label52 = new System.Windows.Forms.Label();
+            this.txt_setCountry = new System.Windows.Forms.TextBox();
+            this.label51 = new System.Windows.Forms.Label();
+            this.label50 = new System.Windows.Forms.Label();
+            this.txt_setSex = new System.Windows.Forms.TextBox();
+            this.label49 = new System.Windows.Forms.Label();
+            this.txt_setSign = new System.Windows.Forms.TextBox();
+            this.label48 = new System.Windows.Forms.Label();
+            this.txt_setNickName = new System.Windows.Forms.TextBox();
             this.button41 = new System.Windows.Forms.Button();
             this.label44 = new System.Windows.Forms.Label();
             this.txt_setWxid = new System.Windows.Forms.TextBox();
@@ -189,21 +208,6 @@
             this.txt_qrcodeLog = new System.Windows.Forms.TextBox();
             this.button42 = new System.Windows.Forms.Button();
             this.button14 = new System.Windows.Forms.Button();
-            this.txt_snsLog = new System.Windows.Forms.TextBox();
-            this.label48 = new System.Windows.Forms.Label();
-            this.txt_setNickName = new System.Windows.Forms.TextBox();
-            this.label49 = new System.Windows.Forms.Label();
-            this.txt_setSign = new System.Windows.Forms.TextBox();
-            this.label50 = new System.Windows.Forms.Label();
-            this.txt_setSex = new System.Windows.Forms.TextBox();
-            this.label51 = new System.Windows.Forms.Label();
-            this.label52 = new System.Windows.Forms.Label();
-            this.txt_setCountry = new System.Windows.Forms.TextBox();
-            this.label53 = new System.Windows.Forms.Label();
-            this.txt_setProvincia = new System.Windows.Forms.TextBox();
-            this.label54 = new System.Windows.Forms.Label();
-            this.txt_setCity = new System.Windows.Forms.TextBox();
-            this.button46 = new System.Windows.Forms.Button();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.tabControl1.SuspendLayout();
             this.tabPage1.SuspendLayout();
@@ -483,6 +487,7 @@
             // 
             // 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);
@@ -509,6 +514,24 @@
             this.tabPage2.Text = "朋友圈模块";
             this.tabPage2.UseVisualStyleBackColor = true;
             // 
+            // button48
+            // 
+            this.button48.Location = new System.Drawing.Point(275, 154);
+            this.button48.Name = "button48";
+            this.button48.Size = new System.Drawing.Size(129, 39);
+            this.button48.TabIndex = 18;
+            this.button48.Text = "查看所有朋友圈";
+            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);
@@ -519,7 +542,7 @@
             // label40
             // 
             this.label40.AutoSize = true;
-            this.label40.Location = new System.Drawing.Point(401, 154);
+            this.label40.Location = new System.Drawing.Point(410, 154);
             this.label40.Name = "label40";
             this.label40.Size = new System.Drawing.Size(82, 15);
             this.label40.TabIndex = 15;
@@ -1108,6 +1131,9 @@
             // 
             // tabPage6
             // 
+            this.tabPage6.Controls.Add(this.button47);
+            this.tabPage6.Controls.Add(this.txt_addUserInfo);
+            this.tabPage6.Controls.Add(this.label55);
             this.tabPage6.Controls.Add(this.button16);
             this.tabPage6.Controls.Add(this.label21);
             this.tabPage6.Controls.Add(this.cb_addtype);
@@ -1128,12 +1154,38 @@
             this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
             this.tabPage6.Size = new System.Drawing.Size(765, 396);
             this.tabPage6.TabIndex = 5;
-            this.tabPage6.Text = "附近的人";
+            this.tabPage6.Text = "加粉引流";
             this.tabPage6.UseVisualStyleBackColor = true;
             // 
+            // button47
+            // 
+            this.button47.Location = new System.Drawing.Point(371, 301);
+            this.button47.Name = "button47";
+            this.button47.Size = new System.Drawing.Size(106, 27);
+            this.button47.TabIndex = 17;
+            this.button47.Text = "搜索";
+            this.button47.UseVisualStyleBackColor = true;
+            this.button47.Click += new System.EventHandler(this.button47_Click);
+            // 
+            // txt_addUserInfo
+            // 
+            this.txt_addUserInfo.Location = new System.Drawing.Point(167, 303);
+            this.txt_addUserInfo.Name = "txt_addUserInfo";
+            this.txt_addUserInfo.Size = new System.Drawing.Size(179, 25);
+            this.txt_addUserInfo.TabIndex = 16;
+            // 
+            // label55
+            // 
+            this.label55.AutoSize = true;
+            this.label55.Location = new System.Drawing.Point(33, 306);
+            this.label55.Name = "label55";
+            this.label55.Size = new System.Drawing.Size(136, 15);
+            this.label55.TabIndex = 15;
+            this.label55.Text = "微信号手机号QQ号:";
+            // 
             // button16
             // 
-            this.button16.Location = new System.Drawing.Point(33, 295);
+            this.button16.Location = new System.Drawing.Point(643, 295);
             this.button16.Name = "button16";
             this.button16.Size = new System.Drawing.Size(90, 41);
             this.button16.TabIndex = 14;
@@ -1707,6 +1759,127 @@
             this.tabPage11.Text = "个人信息";
             this.tabPage11.UseVisualStyleBackColor = true;
             // 
+            // button46
+            // 
+            this.button46.Location = new System.Drawing.Point(370, 311);
+            this.button46.Name = "button46";
+            this.button46.Size = new System.Drawing.Size(98, 25);
+            this.button46.TabIndex = 16;
+            this.button46.Text = "设置资料";
+            this.button46.UseVisualStyleBackColor = true;
+            this.button46.Click += new System.EventHandler(this.button46_Click);
+            // 
+            // label54
+            // 
+            this.label54.AutoSize = true;
+            this.label54.Location = new System.Drawing.Point(65, 314);
+            this.label54.Name = "label54";
+            this.label54.Size = new System.Drawing.Size(52, 15);
+            this.label54.TabIndex = 15;
+            this.label54.Text = "城市:";
+            // 
+            // txt_setCity
+            // 
+            this.txt_setCity.Location = new System.Drawing.Point(123, 311);
+            this.txt_setCity.Name = "txt_setCity";
+            this.txt_setCity.Size = new System.Drawing.Size(220, 25);
+            this.txt_setCity.TabIndex = 14;
+            this.txt_setCity.Text = "guangzhou";
+            // 
+            // label53
+            // 
+            this.label53.AutoSize = true;
+            this.label53.Location = new System.Drawing.Point(65, 267);
+            this.label53.Name = "label53";
+            this.label53.Size = new System.Drawing.Size(52, 15);
+            this.label53.TabIndex = 13;
+            this.label53.Text = "省份:";
+            // 
+            // txt_setProvincia
+            // 
+            this.txt_setProvincia.Location = new System.Drawing.Point(123, 264);
+            this.txt_setProvincia.Name = "txt_setProvincia";
+            this.txt_setProvincia.Size = new System.Drawing.Size(220, 25);
+            this.txt_setProvincia.TabIndex = 12;
+            this.txt_setProvincia.Text = "guangdong";
+            // 
+            // label52
+            // 
+            this.label52.AutoSize = true;
+            this.label52.Location = new System.Drawing.Point(65, 223);
+            this.label52.Name = "label52";
+            this.label52.Size = new System.Drawing.Size(52, 15);
+            this.label52.TabIndex = 11;
+            this.label52.Text = "国籍:";
+            // 
+            // txt_setCountry
+            // 
+            this.txt_setCountry.Location = new System.Drawing.Point(123, 220);
+            this.txt_setCountry.Name = "txt_setCountry";
+            this.txt_setCountry.Size = new System.Drawing.Size(220, 25);
+            this.txt_setCountry.TabIndex = 10;
+            this.txt_setCountry.Text = "CN";
+            // 
+            // label51
+            // 
+            this.label51.AutoSize = true;
+            this.label51.Location = new System.Drawing.Point(367, 178);
+            this.label51.Name = "label51";
+            this.label51.Size = new System.Drawing.Size(38, 15);
+            this.label51.TabIndex = 9;
+            this.label51.Text = "0或1";
+            // 
+            // label50
+            // 
+            this.label50.AutoSize = true;
+            this.label50.Location = new System.Drawing.Point(65, 178);
+            this.label50.Name = "label50";
+            this.label50.Size = new System.Drawing.Size(52, 15);
+            this.label50.TabIndex = 8;
+            this.label50.Text = "性别:";
+            // 
+            // txt_setSex
+            // 
+            this.txt_setSex.Location = new System.Drawing.Point(123, 175);
+            this.txt_setSex.Name = "txt_setSex";
+            this.txt_setSex.Size = new System.Drawing.Size(220, 25);
+            this.txt_setSex.TabIndex = 7;
+            this.txt_setSex.Text = "1";
+            // 
+            // label49
+            // 
+            this.label49.AutoSize = true;
+            this.label49.Location = new System.Drawing.Point(65, 127);
+            this.label49.Name = "label49";
+            this.label49.Size = new System.Drawing.Size(52, 15);
+            this.label49.TabIndex = 6;
+            this.label49.Text = "签名:";
+            // 
+            // txt_setSign
+            // 
+            this.txt_setSign.Location = new System.Drawing.Point(123, 124);
+            this.txt_setSign.Name = "txt_setSign";
+            this.txt_setSign.Size = new System.Drawing.Size(220, 25);
+            this.txt_setSign.TabIndex = 5;
+            this.txt_setSign.Text = "微信协议看:https://github.com/changtuiqie/Mac.WeChat";
+            // 
+            // label48
+            // 
+            this.label48.AutoSize = true;
+            this.label48.Location = new System.Drawing.Point(65, 74);
+            this.label48.Name = "label48";
+            this.label48.Size = new System.Drawing.Size(52, 15);
+            this.label48.TabIndex = 4;
+            this.label48.Text = "昵称:";
+            // 
+            // txt_setNickName
+            // 
+            this.txt_setNickName.Location = new System.Drawing.Point(123, 71);
+            this.txt_setNickName.Name = "txt_setNickName";
+            this.txt_setNickName.Size = new System.Drawing.Size(220, 25);
+            this.txt_setNickName.TabIndex = 3;
+            this.txt_setNickName.Text = "MacWeChat";
+            // 
             // button41
             // 
             this.button41.Location = new System.Drawing.Point(358, 24);
@@ -1823,135 +1996,6 @@
             this.button14.UseVisualStyleBackColor = true;
             this.button14.Click += new System.EventHandler(this.button14_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;
-            // 
-            // label48
-            // 
-            this.label48.AutoSize = true;
-            this.label48.Location = new System.Drawing.Point(65, 74);
-            this.label48.Name = "label48";
-            this.label48.Size = new System.Drawing.Size(52, 15);
-            this.label48.TabIndex = 4;
-            this.label48.Text = "昵称:";
-            // 
-            // txt_setNickName
-            // 
-            this.txt_setNickName.Location = new System.Drawing.Point(123, 71);
-            this.txt_setNickName.Name = "txt_setNickName";
-            this.txt_setNickName.Size = new System.Drawing.Size(220, 25);
-            this.txt_setNickName.TabIndex = 3;
-            this.txt_setNickName.Text = "MacWeChat";
-            // 
-            // label49
-            // 
-            this.label49.AutoSize = true;
-            this.label49.Location = new System.Drawing.Point(65, 127);
-            this.label49.Name = "label49";
-            this.label49.Size = new System.Drawing.Size(52, 15);
-            this.label49.TabIndex = 6;
-            this.label49.Text = "签名:";
-            // 
-            // txt_setSign
-            // 
-            this.txt_setSign.Location = new System.Drawing.Point(123, 124);
-            this.txt_setSign.Name = "txt_setSign";
-            this.txt_setSign.Size = new System.Drawing.Size(220, 25);
-            this.txt_setSign.TabIndex = 5;
-            this.txt_setSign.Text = "微信协议看:https://github.com/changtuiqie/Mac.WeChat";
-            // 
-            // label50
-            // 
-            this.label50.AutoSize = true;
-            this.label50.Location = new System.Drawing.Point(65, 178);
-            this.label50.Name = "label50";
-            this.label50.Size = new System.Drawing.Size(52, 15);
-            this.label50.TabIndex = 8;
-            this.label50.Text = "性别:";
-            // 
-            // txt_setSex
-            // 
-            this.txt_setSex.Location = new System.Drawing.Point(123, 175);
-            this.txt_setSex.Name = "txt_setSex";
-            this.txt_setSex.Size = new System.Drawing.Size(220, 25);
-            this.txt_setSex.TabIndex = 7;
-            this.txt_setSex.Text = "1";
-            // 
-            // label51
-            // 
-            this.label51.AutoSize = true;
-            this.label51.Location = new System.Drawing.Point(367, 178);
-            this.label51.Name = "label51";
-            this.label51.Size = new System.Drawing.Size(38, 15);
-            this.label51.TabIndex = 9;
-            this.label51.Text = "0或1";
-            // 
-            // label52
-            // 
-            this.label52.AutoSize = true;
-            this.label52.Location = new System.Drawing.Point(65, 223);
-            this.label52.Name = "label52";
-            this.label52.Size = new System.Drawing.Size(52, 15);
-            this.label52.TabIndex = 11;
-            this.label52.Text = "国籍:";
-            // 
-            // txt_setCountry
-            // 
-            this.txt_setCountry.Location = new System.Drawing.Point(123, 220);
-            this.txt_setCountry.Name = "txt_setCountry";
-            this.txt_setCountry.Size = new System.Drawing.Size(220, 25);
-            this.txt_setCountry.TabIndex = 10;
-            this.txt_setCountry.Text = "CN";
-            // 
-            // label53
-            // 
-            this.label53.AutoSize = true;
-            this.label53.Location = new System.Drawing.Point(65, 267);
-            this.label53.Name = "label53";
-            this.label53.Size = new System.Drawing.Size(52, 15);
-            this.label53.TabIndex = 13;
-            this.label53.Text = "省份:";
-            // 
-            // txt_setProvincia
-            // 
-            this.txt_setProvincia.Location = new System.Drawing.Point(123, 264);
-            this.txt_setProvincia.Name = "txt_setProvincia";
-            this.txt_setProvincia.Size = new System.Drawing.Size(220, 25);
-            this.txt_setProvincia.TabIndex = 12;
-            this.txt_setProvincia.Text = "guangdong";
-            // 
-            // label54
-            // 
-            this.label54.AutoSize = true;
-            this.label54.Location = new System.Drawing.Point(65, 314);
-            this.label54.Name = "label54";
-            this.label54.Size = new System.Drawing.Size(52, 15);
-            this.label54.TabIndex = 15;
-            this.label54.Text = "城市:";
-            // 
-            // txt_setCity
-            // 
-            this.txt_setCity.Location = new System.Drawing.Point(123, 311);
-            this.txt_setCity.Name = "txt_setCity";
-            this.txt_setCity.Size = new System.Drawing.Size(220, 25);
-            this.txt_setCity.TabIndex = 14;
-            this.txt_setCity.Text = "guangzhou";
-            // 
-            // button46
-            // 
-            this.button46.Location = new System.Drawing.Point(370, 311);
-            this.button46.Name = "button46";
-            this.button46.Size = new System.Drawing.Size(98, 25);
-            this.button46.TabIndex = 16;
-            this.button46.Text = "设置资料";
-            this.button46.UseVisualStyleBackColor = true;
-            this.button46.Click += new System.EventHandler(this.button46_Click);
-            // 
             // FormDemo
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -2177,5 +2221,9 @@
         private System.Windows.Forms.Label label52;
         private System.Windows.Forms.TextBox txt_setCountry;
         private System.Windows.Forms.Button button46;
+        private System.Windows.Forms.Button button47;
+        private System.Windows.Forms.TextBox txt_addUserInfo;
+        private System.Windows.Forms.Label label55;
+        private System.Windows.Forms.Button button48;
     }
 }

+ 17 - 1
IPADDemo/FormDemo.cs

@@ -78,7 +78,7 @@ namespace IPADDemo
 
         private void button1_Click(object sender, EventArgs e)
         {
-            weChatThread.Wx_SendMsg(txt_msgWxid.Text, txt_msgText.Text);
+            var res=weChatThread.Wx_SendMsg(txt_msgWxid.Text, txt_msgText.Text);
         }
 
         private void button2_Click(object sender, EventArgs e)
@@ -360,6 +360,14 @@ namespace IPADDemo
             txt_snsLog.Text = res.ConvertToString();
         }
 
+
+        private void button48_Click(object sender, EventArgs e)
+        {
+            var res = weChatThread.Wx_SnsTimeline("");
+            txt_snsLog.Text = res.ConvertToString();
+        }
+
+
         private void button35_Click(object sender, EventArgs e)
         {
             var res = weChatThread.Wx_GetContact(txt_friendwxid.Text);
@@ -413,5 +421,13 @@ namespace IPADDemo
             var res = weChatThread.Wx_SetUserInfo(txt_setNickName.Text,txt_setSign.Text,txt_setSex.Text.ConvertToInt32(),txt_setCountry.Text,txt_setProvincia.Text,txt_setCity.Text);
 
         }
+
+        private void button47_Click(object sender, EventArgs e)
+        {
+            var res = weChatThread.Wx_SearchContact(txt_addUserInfo.Text);
+            txt_positionReturn.Text = res.ToString();
+        }
+
+       
     }
 }

+ 1 - 3
IPADDemo/IPADDemo.csproj

@@ -92,9 +92,6 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\dll\Xzy.IPAD.Core.dll</HintPath>
     </Reference>
-    <Reference Include="Xzy.WebWx.Core">
-      <HintPath>..\..\WebWx.Core\dll\Xzy.WebWx.Core.dll</HintPath>
-    </Reference>
     <Reference Include="Xzy.WebWx.Model">
       <HintPath>..\..\..\WebWx.Core\dll\Xzy.WebWx.Model.dll</HintPath>
     </Reference>
@@ -139,6 +136,7 @@
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="TestAPI.cs" />
+    <Compile Include="Util\Base64.cs" />
     <Compile Include="Util\BaseClass.cs" />
     <Compile Include="Util\HttpUtil.cs" />
     <Compile Include="Util\MyUtils.cs" />

+ 1 - 0
IPADDemo/TestAPI.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using IPADDemo;
+using Xzy.IPAD.Core;
 
 namespace IPADDemo
 {

+ 65 - 0
IPADDemo/Util/Base64.cs

@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IPADDemo.Util
+{
+    public static class Base64
+    {
+        /// <summary>
+        /// Base64加密
+        /// </summary>
+        /// <param name="codeName">加密采用的编码方式</param>
+        /// <param name="source">待加密的明文</param>
+        /// <returns></returns>
+        public static string EncodeBase64(Encoding encode, string source)
+        {
+            byte[] bytes = encode.GetBytes(source);
+            string encoding = Convert.ToBase64String(bytes);
+            return encoding;
+        }
+
+        /// <summary>
+        /// Base64加密,采用utf8编码方式加密
+        /// </summary>
+        /// <param name="source">待加密的明文</param>
+        /// <returns>加密后的字符串</returns>
+        public static string EncodeBase64(string source)
+        {
+            return EncodeBase64(Encoding.Default, source);
+        }
+
+        /// <summary>
+        /// Base64解密
+        /// </summary>
+        /// <param name="codeName">解密采用的编码方式,注意和加密时采用的方式一致</param>
+        /// <param name="result">待解密的密文</param>
+        /// <returns>解密后的字符串</returns>
+        public static string DecodeBase64(Encoding encode, string result)
+        {
+            string decode = "";
+            byte[] bytes = Convert.FromBase64String(result);
+            try
+            {
+                decode = encode.GetString(bytes);
+            }
+            catch
+            {
+                decode = result;
+            }
+            return decode;
+        }
+
+        /// <summary>
+        /// Base64解密,采用utf8编码方式解密
+        /// </summary>
+        /// <param name="result">待解密的密文</param>
+        /// <returns>解密后的字符串</returns>
+        public static string DecodeBase64(string result)
+        {
+            return DecodeBase64(Encoding.Default, result);
+        }
+    }
+}

+ 37 - 0
IPADDemo/Util/MyUtils.cs

@@ -71,5 +71,42 @@ namespace IPADDemo.Util
         {
             return Convert.ToBase64String(image.ImageToBytes());
         }
+
+        /// <summary>
+        /// 字符串转16进制
+        /// </summary>
+        /// <param name="s"></param>
+        /// <param name="encode"></param>
+        /// <returns></returns>
+        public static string StringToHexString(string s, Encoding encode)
+        {
+            byte[] b = encode.GetBytes(s);//按照指定编码将string编程字节数组
+            string result = string.Empty;
+            for (int i = 0; i < b.Length; i++)//逐字节变为16进制字符
+            {
+                result += Convert.ToString(b[i], 16);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 16进制转字符串
+        /// </summary>
+        /// <param name="hs"></param>
+        /// <param name="encode"></param>
+        /// <returns></returns>
+        public static string HexStringToString(string hs, Encoding encode)
+        {
+            string strTemp = "";
+            byte[] b = new byte[hs.Length / 2];
+            for (int i = 0; i < hs.Length / 2; i++)
+            {
+                strTemp = hs.Substring(i * 2, 2);
+                b[i] = Convert.ToByte(strTemp, 16);
+            }
+            //按照指定编码将字节数组变为字符串
+            return encode.GetString(b);
+        }
+
     }
 }

+ 39 - 1
IPADDemo/WeChat/XzyWeChatThread.cs

@@ -18,6 +18,7 @@ using IPADDemo.Util;
 using System.Configuration;
 using System.Text.RegularExpressions;
 using IPADDemo.AppData;
+using Xzy.IPAD.Core;
 
 namespace IPADDemo.WeChat
 {
@@ -689,7 +690,7 @@ namespace IPADDemo.WeChat
         /// </summary>
         /// <param name="wxid"></param>
         /// <param name="content"></param>
-        public unsafe void Wx_SendMsg(string wxid, string content)
+        public unsafe string Wx_SendMsg(string wxid, string content)
         {
             WxDelegate.show(string.Format("发送文字: {0}", content));
             content = content.Replace(" ", "\r\n");
@@ -699,6 +700,7 @@ namespace IPADDemo.WeChat
                 var datas = MarshalNativeToManaged((IntPtr)msgPtr);
                 var str = datas.ToString();
                 Wx_ReleaseEX(ref msgPtr);
+                return str;
             }
         }
 
@@ -1338,6 +1340,24 @@ namespace IPADDemo.WeChat
             return result;
         }
 
+        /// <summary>
+        /// 查看朋友圈 ID第一次传空
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
+        public unsafe string Wx_SnsTimeline(string id)
+        {
+            var result = "";
+            fixed (int* WxUser1 = &pointerWxUser, msgptr1 = &msgPtr)
+            {
+                XzyWxApis.WXSnsTimeline(pointerWxUser, id, (int)msgptr1);
+                var datas = MarshalNativeToManaged((IntPtr)msgPtr);
+                result = datas.ToString();
+                Wx_ReleaseEX(ref msgPtr);
+            }
+            return result;
+        }
+
         /// <summary>
         /// 删除评论、点赞
         /// </summary>
@@ -1715,6 +1735,24 @@ namespace IPADDemo.WeChat
             return result;
         }
 
+        /// <summary>
+        /// 搜索用户信息
+        /// </summary>
+        /// <param name="user"></param>
+        /// <returns></returns>
+        public unsafe string Wx_SearchContact(string user)
+        {
+            var result = "";
+            fixed (int* WxUser1 = &pointerWxUser, msgptr1 = &msgPtr)
+            {
+                XzyWxApis.WXSearchContact(pointerWxUser, user,(int)msgptr1);
+                var datas = MarshalNativeToManaged((IntPtr)msgPtr);
+                result = datas.ToString();
+                Wx_ReleaseEX(ref msgPtr);
+            }
+            return result;
+        }
+
         /// <summary>
         /// 获取62数据
         /// </summary>

BIN
IPADDemo/bin/Debug/IPADDemo.exe


BIN
IPADDemo/bin/Debug/IPADDemo.pdb


BIN
IPADDemo/bin/Debug/Xzy.IPAD.Core.dll


BIN
IPADDemo/bin/Debug/Xzy.IPAD.Core.pdb


BIN
IPADDemo/bin/Debug/Xzy.WebWx.Core.dll


BIN
IPADDemo/bin/Debug/Xzy.WebWx.Model.dll


BIN
IPADDemo/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache


BIN
IPADDemo/obj/Debug/IPADDemo.FormDemo.resources


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

@@ -1 +1 @@
-8a3f3b398d58fff56d86e2c33effd1b006c205fd
+7210d38ca6fe941cb80c1e6d360d7d3785a84634

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

@@ -181,3 +181,4 @@ C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\obj\Debug\IPADDemo.csproj.CoreCompi
 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
+C:\xm\git\Xzy.Mac.WeChat\Mac.WeChat\IPADDemo\bin\Debug\Xzy.IPAD.Core.pdb

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


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


BIN
IPADDemo/obj/Debug/IPADDemo.exe


BIN
IPADDemo/obj/Debug/IPADDemo.pdb


BIN
dll/Xzy.IPAD.Core.dll


BIN
dll/Xzy.IPAD.Core.pdb