检测无效的快捷方式 [英] detect invalid shortcuts

查看:43
本文介绍了检测无效的快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找链接无效的无效快捷键?

How can I find invalid shortcuts which have a bad link?

推荐答案

嗨!

您可能想尝试一下:
Hi!

You might want to try this:
// reference %systemroot%\system32\shell32.dll
// that will generate an interop wrapper
Shell32.ShellClass Shell = new Shell32.ShellClass();
Shell32.Folder folder = Shell.NameSpace(@"./SomePath");
Shell32.FolderItem file = folder.Items().Item("nameofshortcut.lnk");
Shell32.ShellLinkObject link = (Shell32.ShellLinkObject)file.GetLink;

string Link_Path = link.Path;
if(!File.Exists(LinkPath)
{
    //Do something appropriate here
}



干杯

Manfred



Cheers

Manfred


<pre><big><small><a href=""></a> ;P :( :( :(( :(( :(( :(( :(( :omg: :confused::confused::rose::rose::thumbsdown::thumbsup::thumbsup::mad::mad:</small></big></pre>:((:((:sigh:; P:laugh::) :) :-D;):(:doh::rolleyes::〜:suss :: rose :: thumbsdown :: thumbsdown :: thumbsdown :: thumbsdown :: thumbsdown :: thumbsdown :: thumbsup :: thumbsup :: cool:X |:suss ::〜:mad ::〜:suss :: thumbsdown :: thumbsdown :: thumbsup:
<pre><big><small><a href=""></a> ;P :( :( :(( :(( :(( :(( :(( :omg: :confused::confused::rose::rose::thumbsdown::thumbsup::thumbsup::mad::mad:</small></big></pre> :(( :(( :sigh: ;P :laugh: :) :) :-D ;) :( :doh: :rolleyes: :~:suss::rose::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsdown::thumbsup::thumbsup::cool: X| :suss::~:mad::~:suss::thumbsdown::thumbsdown::thumbsup:


这篇关于检测无效的快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆