System.IO.Packaging
어셈블리를 사용하여 zip 패키지를 읽을 때 표준 Windows zip 유틸리티를 사용하여 만든 zip 파일을 읽을 수 없습니다 (패키지 파트 (내부 파일)은 존재하지 않는 것으로 표시됩니다.System.IO.Packaging 라이브러리가 표준 Windows zip 파일을 읽지 않음
몇 가지 연구를하고 후에는 System.IO.Packaging
라이브러리 우편을 압축 표준 창에 존재 나타나지 않습니다가 생성 된 지퍼,에 Content_Types.xml을 추가하기 때문입니다 것으로 보인다.
예 :
using (Package Zip = Package.Open(BundlePath, FileMode.Open))
{
Uri FileUri = PackUriHelper.CreatePartUri(new Uri("somefile.xml", UriKind.Relative));
if (!Zip.PartExists (FileUri)) //this fails even though the file exists in the zip
throw new ResourceException(String.Format("Zip {0} does not contain file", BundlePath));
...
는 여전히 표준 zip 파일을 읽을 .NET에서 제공하는 포장 시스템을 사용하는 어쨌든 거기에, 또는 라이브러리를 사용하여 작성해야합니까.
편집 :
수동으로 파일 (Content_Types.xml)을 추가하고, 윈도우 압축 유틸리티를 사용하여 압축하는 패키지를 읽을 수 있도록에서 성공을 증명한다.
감사합니다.
"표준 Windows zip 유틸리티"란 무엇입니까? – Oded
@Oded - Windows XP, Windows 7 등과 함께 제공되는 기본 압축 유틸리티 – cweston
XP와 함께 제공되는 것을 모르는 상태에서 다시 묻습니다. – Oded