2010-09-04 73 views
4

我在XP 32位操作系统中使用此代码获取%windir%\windows\system32文件夹路径。Windows 7中的System32文件夹

sysFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.System) 

我想知道的是,将在Windows 7(64位/ 32位)使用时,相同的代码返回%windir%\windows\syswow64文件夹?

回答

0

没有。在我的Windows 7 64位中,针对64:

C:\Windows\system32
1

我想在我的Windows7的盒子.NET 4.0

此代码:

Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.System)); 
Console.WriteLine(Environment.GetFolderPath(Environment.SpecialFolder.SystemX86)); 

打印从32位以下和64位的过程:

C:\Windows\system32 
C:\Windows\SysWOW64 
5

它将返回C:\ Windows \ System32下,即使在对64位versio运行32位程序Windows的n。做不是修复这个,它不需要修复。因为当你使用那个路径时,Windows会自动将它重新映射到c:\ windows \ syswow64。 file system redirector照顾它。

+0

@ Hans Passant +1为您的知识 – ElektroStudios 2013-05-14 17:12:33

相关问题