【发布时间】:2014-02-23 21:30:44
【问题描述】:
我有一段代码在 Windows XP 上运行没有问题。不是我们公司已经迁移到windows 7 并且软件停止工作。解码代码本身会打开一个 zip 文件并提取内容。跟着它读取内容。
Dim tempzip As String = "C:\ some very long path\bin\Debug\lib.zip"
Dim tempdir As String = IO.Path.Combine(IO.Path.GetTempPath, Guid.NewGuid.ToString)
Using zip1 As Ionic.Zip.ZipFile = Ionic.Zip.ZipFile.Read(tempzip)
Dim e As Ionic.Zip.ZipEntry
For Each e In zip1
e.Extract(tempdir, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently)
Next
End Using
PropertiesAssembly = System.Reflection.Assembly.LoadFrom(IO.Path.Combine(tempdir, "some dll in zip-file"))
错误发生在 e.Extract 。他显然找不到压缩文件。抛出的异常是你的标准Could not find file or part of file...
Zip-文件确实存在在指定位置,并且所需的程序集存在在 zip 文件中。代码尚未更改。这只是一个检查工作的测试。
问题: windows 7 和 windows xp 在文件处理方面有区别吗? 如果不是,这种奇怪行为的原因可能是什么
【问题讨论】:
标签: .net vb.net path zip filenotfoundexception