Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 防止向最近的文档中添加文件_C#_Powershell_Registry_Recent Documents - Fatal编程技术网

C# 防止向最近的文档中添加文件

C# 防止向最近的文档中添加文件,c#,powershell,registry,recent-documents,C#,Powershell,Registry,Recent Documents,我有一个应用程序使用两种不同类型的文件。第一种文件类型是项目文件(称为*.pcwex),第二种文件类型是库文件(称为*.pcwlx)。 如果使用“文件打开”对话框(文件扩展名*.pcwex)打开项目文件,则应将此文件名添加到此应用程序的“最近使用的文档”列表中。 如果将库添加到打开的项目中,我也会使用“文件打开”对话框(但文件扩展名为*.pcwlx)。但此库文件不应添加到“最近使用的文件”列表中,因为它不能作为项目打开 我在注册表中添加了以下条目: [HKEY_CLASSES_ROOT\.pcw

我有一个应用程序使用两种不同类型的文件。第一种文件类型是项目文件(称为*.pcwex),第二种文件类型是库文件(称为*.pcwlx)。
如果使用“文件打开”对话框(文件扩展名*.pcwex)打开项目文件,则应将此文件名添加到此应用程序的“最近使用的文档”列表中。
如果将库添加到打开的项目中,我也会使用“文件打开”对话框(但文件扩展名为*.pcwlx)。但此库文件不应添加到“最近使用的文件”列表中,因为它不能作为项目打开

我在注册表中添加了以下条目:

[HKEY_CLASSES_ROOT\.pcwex]
@="PCWE.pcwex"

[HKEY_CLASSES_ROOT\.pcwex\OpenWithProgids]
"PCWE.pcwex"=""

[HKEY_CLASSES_ROOT\PCWE.pcwex]

[HKEY_CLASSES_ROOT\PCWE.pcwex\DefaultIcon]  
@="C:\\Program Files (x86)\\MyCompany\\MyApplication\\Application.ico"

[HKEY_CLASSES_ROOT\PCWE.pcwex\shell]

[HKEY_CLASSES_ROOT\PCWE.pcwex\shell\open]

[HKEY_CLASSES_ROOT\PCWE.pcwex\shell\open\command]  
@="C:\\Program Files (x86)\\MyCompany\\MyApplication\\MyApp.exe \"%1\""



[HKEY_CLASSES_ROOT\.pcwlx]  
@="PCWE.pcwlx"

[HKEY_CLASSES_ROOT\PCWE.pcwlx]

[HKEY_CLASSES_ROOT\PCWE.pcwlx\DefaultIcon]  
@="C:\\Program Files (x86)\\MyCompany\\MyApplication\\Application.ico"
通过此配置,两种文件类型(*.pcwex*.pcwlx)都将添加到“最近使用的文档”列表中

仅将*.pcwex类型的文件添加到最近的文件列表并忽略*.pcwlx文件需要什么