本方法相对独立,直接放到页面中,调用即可,返回上传后图片的路径,图片名称已经修改为纯数字+后缀名
/// <summary>
/// 上传文件,返回保存的路径/文件名
/// </summary>
/// <param name="fupload">web控件</param>
/// <param name="Folder">文件夹路径</param>
/// <returns></returns>
private string UploadFile(FileUpload fupload, string Folder)
{
string strNewUrl = "";
string strFileOldName = "";
string strFileNewName = "";
strFileOldName = fupload.FileName;
if (strFileOldName.Trim().Length == 0)
{
return "";
}
string fileType = strFileOldName.Substring(strFileOldName.LastIndexOf('.'));
if (fileType.ToUpper() != ".JPG" && fileType.ToUpper() != ".GIF" && fil