/// <summary>
/// 返回上传文件的大小
/// </summary>
/// <param name="fileUpload">ID</param>
/// <returns>文件大小</returns>
public static string GetByte(FileUpload fileUpload)
{
int byteNumber = 0;
if (fileUpload.HasFile)
{
byteNumber = fileUpload.PostedFile.ContentLength / 1000000;//字节大小
}
if (byteNumber > 10)
{
return "上传文档已超过10M!";
}
return "";
}
/// 返回上传文件的大小
/// </summary>
/// <param name="fileUpload">ID</param>
/// <returns>文件大小</returns>
public static string GetByte(FileUpload fileUpload)
{
int byteNumber = 0;
if (fileUpload.HasFile)
{
byteNumber = fileUpload.PostedFile.ContentLength / 1000000;//字节大小
}
if (byteNumber > 10)
{
return "上传文档已超过10M!";
}
return "";
}