从 .net 4 c# 中取消阻止文件 [英] Unblock File from within .net 4 c#
问题描述
是否可以在 c# 程序中取消阻止从 Internet 下载的文件.在网上冲浪我了解到,该信息是写在一个 (NTFS) 文件的替代流中,该文件包含当前区域信息(值 3 来自互联网,被解释为被阻止).
Is there a possibility to unblock a file that is downloaded from the internet from within a c# program. Surfing the internet I have learned, that the information is written in an alternative stream of a (NTFS) file that contains the current zone information (value 3 is from the internet and is interpreted as blocked).
是否有管理的可能性来清除或更改文件的区域信息(取消阻止),或者是否有管理复制功能来复制没有区域信息的文件?如果没有,我如何使用 PInvoke 但不包含外部程序集(我不允许在当前项目中执行此操作).
Is there a managed possiblity to either clear or change the zone information (unblock) of a file or is there a managed copy function that copies the files without the zone information? If not, how can I do with PInvoke but without including a foreign assembly (I'm not allowed to do this in a current project).
推荐答案
它存储在 :Zone.Identifier
流中 (more
It's stored in the :Zone.Identifier
stream (more < c: heapp.exe:Zone.Identifier
) you need to use the native IO routines to manipulate them, here is a managed wrapper.
这篇关于从 .net 4 c# 中取消阻止文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!