2.0上传图片 先把图片保存在服务器上的一个文件夹,在把路径,存到数据库中,怎么做啊,使用fileupload 控件,给一段事例代码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string filePath="",fileExtName="",mFileName,mPath; string path="/Mirror/Temp/"; if("" != fileUp.PostedFile.FileName) { filePath =fileUp.PostedFile.FileName;//取得文件路径 fileExtName= filePath.Substring(filePath.LastIndexOf(".")+1); try { //取得与 Web 服务器上的指定虚拟路径相对应的物理文件路径。 mPath=Server.MapPath("../Temp/"); mFileName=filePath.Substring(filePath.LastIndexOf("\\")+1);;//取得文件名 //保存上传文件到指定的目录 fileUp.PostedFile.SaveAs(mPath + mFileName); UpdateData(estate_text,path + mFileName,estate_type); } catch(Exception error) { Response.Write(error.ToString()); } } string filePath="",fileExtName="",mFileName,mPath;string path="/Mirror/Temp/"; if("" != fileUp.PostedFile.FileName) { filePath =fileUp.PostedFile.FileName;//取得文件路径 fileExtName= filePath.Substring(filePath.LastIndexOf(".")+1); try { //取得与 Web 服务器上的指定虚拟路径相对应的物理文件路径。 mPath=Server.MapPath("../Temp/"); mFileName=filePath.Substring(filePath.LastIndexOf("\\")+1);;//取得文件名 //保存上传文件到指定的目录 fileUp.PostedFile.SaveAs(mPath + mFileName); UpdateData(estate_text,path + mFileName,estate_type); } catch(Exception error) { Response.Write(error.ToString()); } } 如何继承已有的webform 数值转换成万元的问题 调用自定义控键方法问题 如何根据用户的名称进行URL重写... 有什么办法在前面弹出一个alert的警告框,按了确定以后再执行下面的操作,比如清空文本框?? 简单问题请教。 sqlserver2000存储过程 问题 急急急,webconfig的奇怪问题,100分求助 谁有《中国青年出版社》的精通《C#与ASP.NET程序设计》的光盘的源程序 Framework1.0SDK中文版什么时候出?今天是4.19,不是说4月中旬吗? 不知这个参数有什么意思? 数据库的连接
string path="/Mirror/Temp/";
if("" != fileUp.PostedFile.FileName)
{
filePath =fileUp.PostedFile.FileName;//取得文件路径
fileExtName= filePath.Substring(filePath.LastIndexOf(".")+1); try
{
//取得与 Web 服务器上的指定虚拟路径相对应的物理文件路径。
mPath=Server.MapPath("../Temp/");
mFileName=filePath.Substring(filePath.LastIndexOf("\\")+1);;//取得文件名
//保存上传文件到指定的目录
fileUp.PostedFile.SaveAs(mPath + mFileName);
UpdateData(estate_text,path + mFileName,estate_type);
}
catch(Exception error)
{
Response.Write(error.ToString());
}
}
string path="/Mirror/Temp/";
if("" != fileUp.PostedFile.FileName)
{
filePath =fileUp.PostedFile.FileName;//取得文件路径
fileExtName= filePath.Substring(filePath.LastIndexOf(".")+1); try
{
//取得与 Web 服务器上的指定虚拟路径相对应的物理文件路径。
mPath=Server.MapPath("../Temp/");
mFileName=filePath.Substring(filePath.LastIndexOf("\\")+1);;//取得文件名
//保存上传文件到指定的目录
fileUp.PostedFile.SaveAs(mPath + mFileName);
UpdateData(estate_text,path + mFileName,estate_type);
}
catch(Exception error)
{
Response.Write(error.ToString());
}
}