在提问之前,对不起我的英语,不是我的母语。
我认为标题解释了,我试图知道用户PC是否在system32文件夹中有一个dll,但即使我将.dll移动到桌面(用于测试目的),File.Exists也会返回True。 / p>
我正在使用的代码:
Imports System.IO
Public sys32Path As String = "C:\Windows\System32\"
If File.Exists(sys32Path + "d3dx9_42.dll") = True Then
ListBox1.Refresh()
ListBox1.Items.Add(sys32Path + "d3dx9_42.dll | Found !")
fstDLL = True
ElseIf File.Exists(sys32Path + "d3dx9_42.dll") = False Then
ListBox1.Refresh()
ListBox1.Items.Add("d3dx9_42.dll | Missing !")
fstDLL = False
End If
答案 0 :(得分:0)
请记住,如果在64位系统上运行32位应用程序,则file system redirection会将C:\Windows\System32
重定向到C:\Windows\SysWOW64
,这是“System32”文件夹32位应用程序。
如果要访问实际的System32文件夹,则可以:
C:\Windows\SysNative
或:答案 1 :(得分:0)
我发现了“问题”。真的很简单;( 因为我在x64架构中,即使dll不在system32中,sysWOW64中的dll也可以在File.Exists中将值设置为true(如果不在system32中,程序会使用sysWOW64,我认为)。 / p>