string path = Server.MapPath("./");
中的path值是什么啊?
中的path值是什么啊?
解决方案 »
- 新浪微博加载怎么做
- VS2008成功发布了网站,但是。。。
- 哪有三级联动下拉框代码啊?能用的。需要从数据库提取数据。可用的加分!
- 取样取服务器的域名!!在ASP.NET中
- 进来看看,这个如何实现.......如果你不帮忙我就死定了..失业了.............歇息饿了
- 基于数据库的form验证
- 为什么我把我的asp.net程序拷贝到别的机器上就无法运行了呢
- 自定义控件我设置的属性无法在vs.net属性面板中找到。但是运行又很正常
- 一个类方法中引用另一个类方法的对象数组
- ASP.net中CMYK与RGB图像格式的互换问题?
- 我在asp.net编网页时,有一个问题,请高手帮帮忙
- asp.net调试,在线等待????????????????????????????
string TempFileName;
TempFileName = "C:\\TempFiles\\";
MyFileCollection[0].SaveAs(TempFileName);仍然会出现同样的问题!
仍然不行,同样的错误!
{
images_Message.Text = "请选择要上传的源文件!";
return ;
}
HttpPostedFile myFile = Tb_TrunFile.PostedFile;
string SourFile = Tb_TrunFile.PostedFile.FileName; //返回的是通过文件对话框选择的文件名
string images_Name = Path.GetFileName(SourFile);//' 去掉目录信息,返回文件名称
string newext=System.IO.Path.GetExtension(myFile.FileName).ToLower();
//if((System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".jpg") || (System.IO.Path.GetExtension(myFile.FileName).ToLower() != ".bmp")||(System.IO.Path.GetFileName(myFile.FileName).ToLower() != ".gif"))
//int i= images_Name.LastIndexOf(".");
//--获得扩展名
//string newext =images_Name.Substring(i);
if(newext.Equals(".jpg")==false && newext.Equals(".bmp")==false && newext.Equals(".gif")==false)
{
LabelMessage.Text="The file must have an extension of jPG or BMP or GIG";
return;
}
//string DestPath =@"C://Inetpub//wwwroot//center//image//";
string DestPath=@"D://center_new_spieler_0331//image//";
string test=DestPath.Trim() + images_Name;
DestFile[images_news_test]=test;//生成目的文件路径 if(DestFile[images_news_test].Trim().Length == 0)
{
images_Message.Text = "请输入要上传的目的文件!";
return ;
} if(!Directory.Exists(DestPath))
{
Directory.CreateDirectory(DestPath);
}
Tb_TrunFile.PostedFile.SaveAs(DestFile[images_news_test]);
DestFile[images_news_test]=images_Name;
images_list.Items.Add(DestFile[images_news_test]);
images_news_test++;
images_Message.Text="第"+images_news_test+"张图片上传成功";
}
catch(Exception ex)
{
images_Message.Text=ex.Message+"上传出错";
}
[email protected]谢谢!