如何在vb.net中找到.lnk文件的目的地

Dee*_*Dee 2 vb.net file lnk

我做了一个explorer.exe克隆,有一个树视图和一个列表视图等。

现在,我需要处理单击.lnk文件的操作,因此我需要.lnk文件的目标路径。

slo*_*oth 5

您可以使用WshShell Object

每当您要在本地运行程序,操纵注册表的内容,创建快捷方式或访问系统文件夹时,就可以创建WshShell对象。

并使用其CreateShortcut方法:

创建一个新的快捷方式,或打开一个现有的快捷方式。

结果WshShortcut对象包含一个TargetPath您正在寻找的属性。

例:

Dim shell = CreateObject("WScript.Shell")
Dim path  = shell.CreateShortcut(path_to_your_link).TargetPath
Run Code Online (Sandbox Code Playgroud)