本文介绍了根据文件大小将文件写入文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我需要帮助。我有一个文件列表,我想根据文件大小写入4个文件夹。是否可以在vb.net中执行此操作?



谢谢。

Hi There,

I am in need of help. I have a list of files that I want to write to 4 folders according to their file size. Is it possible to do this in vb.net?

thanks.

推荐答案

Dim infoReader As System.IO.FileInfo
infoReader = My.Computer.FileSystem.GetFileInfo("C:\testfile.txt")
MsgBox("File is " & infoReader.Length & " bytes.")





您可以使用以下内容:



You can use this as the follows:

Dim infoReader As System.IO.FileInfo

infoReader = My.Computer.FileSystem.GetFileInfo("C:\testfile.txt")

If infoReader.Length < 1000 Then
    'your code for separation

Else
    'your code for equal or bigger than 1000 bytes file

End If



这篇关于根据文件大小将文件写入文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 22:44
查看更多