当pdf大小为0byte时如何删除文件 [英] how to delete a file when pdf size is 0byte
本文介绍了当pdf大小为0byte时如何删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当PDF尺寸为0Byte时,我们如何删除或移动文件。
i已放置样本文件和示例代码。
How can we delete or move a file when PDF size is 0Byte.
i have placed sample files and sample code.
If file.exist(d:\source\test1.pdf) then
File.move(d:\source\test1.pdf, d:\destination\test1.pdf)
End If
或
or
If file.exist(d:\source\test1.pdf) then
File.delete(d:\source\test1.pdf, d:\destination\test1.pdf)
End If
当pdf大小为0时,两个代码都不起作用
注意:我们无法预览此pdf。我们可以从下面的位置下载pdf后查看
https://drive.google.com/file/d/0B_nzYHWVJJ7KaVZfQUZJVmsxUXM/view?usp=sharing [ ^ ]
推荐答案
这是如何:
http:/ /msdn.microsoft.com/en-us/library/system.io.fileinfo.length%28v=vs.110%29.aspx [ ^ ],
http://msdn.microsoft.com/ en-us / library / system.io.file.delete(v = vs.110).aspx [ ^ ]。
-SA
This is how:
http://msdn.microsoft.com/en-us/library/system.io.fileinfo.length%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.io.file.delete(v=vs.110).aspx[^].
—SA
如果问题是...因为它正被另一个进程使用,请看我过去的回答:
如何压缩错误'它已被vb.net中的另一个进程使用' [ ^ ]。
-SA
If the problem is "…because it is being used by another process", please see my past answer:
how to compress the error 'it is already used by another process' in vb.net[^].
—SA
这篇关于当pdf大小为0byte时如何删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文