这篇文章主要介绍了上传图片后使用数据库保存图片的示例,需要的朋友可以参考下
代码如下:HttpPostedFile UpFile = File1.PostedFile;int FileLenght = UpFile.ContentLength;decimal FileSize = FileLenght / 1024;if (FileLenght == 0){ DIVShowGVError.Visible = true; LblShowGVError.Text = "请选择上传文件"; return;}string strImageName = UpFile.FileName;string strImageType = strImageName.Substring(strImageName.LastIndexOf(".")).ToLower();if (strImageType != ".jpg" && strImageType != ".jpeg" && strImageType != ".bmp" && strImageType != ".png"){ DIVShowGVError.Visible = true; LblShowGVError.Text = "