EveryThing搜索优化

This commit is contained in:
BookerLiu
2023-04-04 17:59:06 +08:00
parent 3654ec393a
commit 1fce566f4a
8 changed files with 1533 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using File = System.IO.File;
namespace GeekDesk.Util
{
@@ -45,17 +46,22 @@ namespace GeekDesk.Util
/// <returns></returns>
public static string GetArgByLnk(string filePath)
{
//return "";
try
{
WshShell shell = new WshShell();
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath);
return shortcut.Arguments;
if (File.Exists(filePath))
{
object shortcutObj = shell.CreateShortcut(filePath);
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shortcutObj;
return shortcut.Arguments;
}
}
catch (Exception e)
{
//LogUtil.WriteErrorLog(e, "获取启动参数失败! filePath=" + filePath);
return "";
}
return "";
}
/// <summary>