uuencode.decode删除文件失败后解码后
我正在使用uuencode.decode
来解码一批uuencoded文件。有时,uuencoded文件之一是损坏的,导致uuencode.decode
终止。我用尝试.. catch ..结束尝试
,它成功地处理了无法解码特定的Uuencoded文件。
对于下一步,我需要删除Uuencoded文件。如果uuencode.decode
成功,那么我可以继续删除uuencoded文件,但是如果uuencode.decode失败,导致捕获量,那么我将无法删除该文件,因为该文件仍然打开。
知道如何关闭uuencode.decode剩下的文件,以便我可以继续删除它?
这是代码:
Try
strOutputFilename = UUEncode.Decode(lblWorkingPath.Text & strFilename & ".uu", lblWorkingPath.Text)
Catch ex As Exception
strOutputFilename = ""
End Try
File.Delete(lblWorkingPath.Text & strFilename & ".uu")
I am using UUEncode.Decode
to decode a batch of UUEncoded files. Occasionally one of the UUEncoded files is corrupt, causing UUEncode.Decode
to terminate. I handle this with Try .. Catch .. End Try
, which successfully handles the failure to decode a particular UUEncoded file.
For the next step I need to delete the UUEncoded file. If the UUEncode.Decode
was successful then I can go on to delete the UUEncoded file, but if the UUEncode.Decode failed, causing a catch, then I cannot delete the file as it is still open.
Any idea how to close the file left open by UUEncode.Decode so that I can proceed to delete it?
Here is the code:
Try
strOutputFilename = UUEncode.Decode(lblWorkingPath.Text & strFilename & ".uu", lblWorkingPath.Text)
Catch ex As Exception
strOutputFilename = ""
End Try
File.Delete(lblWorkingPath.Text & strFilename & ".uu")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论