调用:
//创建给类别的图片保存目录
var path
path = "C:\temp\";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
if(this.file.PostedFile.FileName != "")
{
string[] filetype = new string[]{"jpg","gif","png","JPG","GIF","PNG"};
filename = new Upload().UploadFile(path , 204800, filetype, file);
}