展开全部
取到上传图片的路径和dotnettextbox的值就可以了啊
更多追问追答
追问
道理我明白(刚学。net,有许多不懂,请见谅),就是不知道怎样做,兄弟拜托了,有代码的拷上来给小弟看看,感激不尽……
追答
//图片处理的方法
protected void Up_Image()
{
bool fileOk = false;
string d = DateTime.Now.ToString("yyyyMMddHHmmss");
string fileExtension = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower();
string path = Server.MapPath("/userfiles/product/") + d + fileExtension;
if (FileUpload1.HasFile)
{
string[] allowedExtensions = { ".gif", ".png", ".bmp", ".jpg", "jpeg" };
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (fileExtension == allowedExtensions[i])
{
fileOk = true;
}
}
if (fileOk)
{
AccessDAL.PhotoControl.MakeThumbnail(FileUpload1.PostedFile, path, 160,124);
AccessDAL.PhotoControl.MakeThumbnail(FileUpload1.PostedFile, big_path, 183,134);
AccessDAL.PhotoControl.MakeThumbnail(FileUpload1.PostedFile, bigger_path, 400);
mypath = "/userfiles/product/" + d + fileExtension;
addinfo(mypath);
}
else
{
lblmsg.Text = "X 图片格式错误。";
}
}
else
{
mypath = "/userfiles/temp/default.jpg";
addinfo(mypath);
}
}
添加的方法,这里写不下了 5555
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询