ソースを参照

1.修复新版获取不到微信的问题
2.修复导出聊天记录时,视频被移动的问题
3.标题新增版本号

Suxue 1 年間 前
コミット
e3cfc67dbd
4 ファイル変更16 行追加8 行削除
  1. 1 0
      Main.xaml.cs
  2. 11 4
      SelectWechat.xaml.cs
  3. 1 1
      WXUserReader.cs
  4. 3 3
      WechatPCMsgBakTool.csproj

+ 1 - 0
Main.xaml.cs

@@ -36,6 +36,7 @@ namespace WechatPCMsgBakTool
             Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
             InitializeComponent();
             LoadWorkspace();
+            this.Title += $" {Application.ResourceAssembly.GetName().Version}";
         }
 
         private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)

+ 11 - 4
SelectWechat.xaml.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
@@ -15,6 +16,7 @@ using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Shapes;
+using System.Xml.Linq;
 using WechatPCMsgBakTool.Helpers;
 using WechatPCMsgBakTool.Model;
 
@@ -39,14 +41,19 @@ namespace WechatPCMsgBakTool
         {
             processInfos.Clear();
             Process[] processes = Process.GetProcessesByName("wechat");
-            foreach(Process p in processes)
+            foreach (Process p in processes)
             {
                 var h_list = ProcessHelper.GetHandles(p);
-                foreach(var h in h_list)
+                foreach (var h in h_list)
                 {
-                    if(h.ObjectType == 40)
+                    string name = ProcessHelper.FindHandleName(h, p);
+                    if (name != "")
                     {
-                        string name = ProcessHelper.FindHandleName(h, p);
+                        // 预留handle log
+                        if (File.Exists("handle.log"))
+                        {
+                            File.AppendAllText("handle.log", string.Format("{0}|{1}|{2}|{3}\n", p.Id, h.ObjectType, h.Handle, name));
+                        }
                         if (name.Contains("\\MicroMsg.db") && name.Substring(name.Length - 3, 3) == ".db")
                         {
                             ProcessInfo info = new ProcessInfo();

+ 1 - 1
WXUserReader.cs

@@ -187,7 +187,7 @@ namespace WechatPCMsgBakTool
                 // 视频的路径是相对路径,需要加上资源目录
                 path = Path.Combine(UserBakConfig.UserResPath, path);
                 if(!File.Exists(video_file_path))
-                    File.Move(path, video_file_path);
+                    File.Copy(path, video_file_path);
                 path = video_file_path;
             }
 

+ 3 - 3
WechatPCMsgBakTool.csproj

@@ -6,9 +6,9 @@
     <Nullable>enable</Nullable>
     <UseWPF>true</UseWPF>
     <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
-    <AssemblyVersion>0.5.0.0</AssemblyVersion>
-    <FileVersion>0.5.0.0</FileVersion>
-    <Version>0.5.0.0</Version>
+    <AssemblyVersion>0.5.0.1</AssemblyVersion>
+    <FileVersion>0.5.0.1</FileVersion>
+    <Version>0.5.0.1</Version>
   </PropertyGroup>
 
   <ItemGroup>