在Windows中搜索损坏的快捷方式 [英] Search for broken shortcuts in Windows
问题描述
我想编写一个搜索硬盘中损坏的快捷方式的软件。我怎样才能做到这一点?你能告诉我如何解决这个问题吗?谢谢。
I want to code a software that search for the broken shortcuts in the Hard Drive. How can I achieve this? Can you give me an idea on how to go about this? Thank you.
推荐答案
伪代码:
Pseudo Code:
foreach(link in RecursivelyGetAllLinksOf(path))
{
if (!File.Exists(link.Ref))
{
Error("Error in {0}: Reference {1} does not exist", link.Path, link.Ref);
}
if (!Directory.Exists(link.WorkDir))
{
Error("Error in {0}: Work directory {1} does not exist", link.Path, link.WorkDir);
}
}
这是你要的吗?
< br $> b $ b
看看:
- 如果路径/文件是快捷方式,我如何以编程方式进行测试? [ ^ ]
- 如何在.NET中使用Shell32库作为COM导入 - 一个整洁的小黑客 [ ^ ]
- 用于Microsoft®.NETFramework的Windows®API代码包 [ ^ ]
[/编辑]
干杯
Andi
Is it this what you ask for?
Have a look at:
- How can I test programmatically if a path/file is a shortcut?[^]
- How to Utilise the Shell32 Library in .NET as a COM Import – A Neat little Hack[^]
- Windows® API Code Pack for Microsoft® .NET Framework[^]
[/EDIT]
Cheers
Andi
这篇关于在Windows中搜索损坏的快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!