发布于 4年前

C# 计算总文件大小

public int CalculateTotalFileSize(string[] path)
{
    int sumFileSize = 0;
    foreach(string onePath in path)
    {
        FileInfo info = new FileInfo(onePath);
        sumFileSize += Convert.ToInt32(info.Length);
    }
    return sumFileSize;
}
©2020 edoou.com   京ICP备16001874号-3