急求!!vb.net 调用 winrar 出错
vb.net吧
全部回复
仅看楼主
level 1
For Each file In files
Try
If Shell(winrar & " e " & file.FullName & " " & tbxTemp.Text, AppWinStyle.Hide) = 0 Then
MsgBox("解压失败:" & file.Name)
Exit Sub
Else
Sleep(5000)
End If
Catch ex As Exception
MsgBox("解压失败:" & ex.Message)
Exit Sub
End Try
Next
这是我用来解压缩文件的代码,在win7上运行正常,但是到了XP上运行时winrar老是报错:No archives found
求高手帮忙
2014年10月23日 03点10分 1
level 10
如果文件路径包含空格,需要用双引号括起来。
VB.NET中的双引号要用 "" 来表示
所以你试试 """" & winrar & """ e """ & file.FullName & """ " & tbxTemp.Text 这样看看行不行
2014年10月23日 05点10分 2
谢谢,我也发现了。
2014年10月24日 00点10分
1