如下代码,用于制作1个zip压缩包,但是当待压缩的文件有中文字符时,会出现乱码。请问如何处理?我不能修改客户端默认的ZIP程序。Dim fileloc As String=Args(0)
Dim filenam,newfileloc As String
If FileSys.DirectoryExists(ProjectPath & "tempfile\zipfs")=False Then
FileSys.CreateDirectory(ProjectPath & "tempfile\zipfs")
End If
Dim zip As New zipFile
filenam=ProjectPath & "tempfile\zipfs\tempzip" & Val2 & ".zip"
Do While FileSys.FileExists(filenam)
Val2 = Rand.Next(1000)
filenam=ProjectPath & "tempfile\zipfs\tempzip" & Val2 & ".zip"
Loop
zip.Create(filenam)
zip.AddFile(fileloc) 就是这里出问题,如果fileloc含有中文字符,则放入zip文件后会被乱码替代掉,并且不能再打开。
zip.Close()
Return filenam
[此贴子已经被作者于2019/2/26 13:36:05编辑过]