通过FileInfo.Length 属性来获取
解决方案 »
- 如何在ASP.NET项目中 加入SL的东西
- 谁用过myxls? 解决单元格内容显示 不完 问题
- 散100分吧 有点郁闷
- laber控件可以有html标签也有Eval绑顶么?
- TreeView怎么了???
- 调用WebService时出的错误,该怎么解决
- 初学者问问题
- 关于autopostbakc的问题,谢谢了!!!!!!!!!!!!
- 使用C#在WebForm里使用StreamReader读取文本文件,中文变成几个乱码。
- 奇怪的sqlDataReader和DataSet?
- GridView使用ajax删除数据
- 大家有没有注意到,在Firefox里面MasterPage只会刷新改变的ContentPlaceHolder
// of the files in the specified directory.
using System;
using System.IO;public class FileLength
{
public static void Main()
{
// Make a reference to a directory.
DirectoryInfo di = new DirectoryInfo("c:\\");
// Get a reference to each file in that directory.
FileInfo[] fiArr = di.GetFiles();
// Display the names and sizes of the files.
Console.WriteLine("The directory {0} contains the following files:", di.Name);
foreach (FileInfo f in fiArr)
Console.WriteLine("The size of {0} is {1} bytes.", f.Name, f.Length);
}
}
我是让别人上传图片,这个路径怎么写?