交互优化, 断网更新弹框删除,图标显示优化,待办任务bug修复
This commit is contained in:
32
Util/FileUtil.cs
Normal file
32
Util/FileUtil.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using IWshRuntimeLibrary;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GeekDesk.Util
|
||||
{
|
||||
public class FileUtil
|
||||
{
|
||||
|
||||
public static string GetTargetPathByLnk(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
WshShell shell = new WshShell();
|
||||
IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(filePath);
|
||||
|
||||
if (StringUtil.IsEmpty(shortcut.TargetPath))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return shortcut.TargetPath;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user