没问题啊
ASP.NET自身就支持文件上传
try
{
string fnm=this.file1.PostedFile.FileName;
fnm=fnm.Substring(fnm.LastIndexOf("\\"));
SqlCommand cmd=new SqlCommand("select top 1 id from "+this.tables.SelectedItem.Value+" order by id desc",(SqlConnection)Application["conn"]);
int id=Int32.Parse(cmd.ExecuteScalar().ToString())+1;
if(!Directory.Exists(Server.MapPath(this.tables.SelectedItem.Value+"\\"+id)))
Directory.CreateDirectory(Server.MapPath(this.tables.SelectedItem.Value+"\\"+id));
this.file1.PostedFile.SaveAs(Server.MapPath(this.tables.SelectedItem.Value+"\\"+id+"\\"+fnm));
this.fileinfo.InnerHtml+=this.tables.SelectedItem.Value+"\\"+id+fnm+"<br>";
}
catch(Exception e1)
{
Response.Write(e1.ToString());
}
ASP.NET自身就支持文件上传
try
{
string fnm=this.file1.PostedFile.FileName;
fnm=fnm.Substring(fnm.LastIndexOf("\\"));
SqlCommand cmd=new SqlCommand("select top 1 id from "+this.tables.SelectedItem.Value+" order by id desc",(SqlConnection)Application["conn"]);
int id=Int32.Parse(cmd.ExecuteScalar().ToString())+1;
if(!Directory.Exists(Server.MapPath(this.tables.SelectedItem.Value+"\\"+id)))
Directory.CreateDirectory(Server.MapPath(this.tables.SelectedItem.Value+"\\"+id));
this.file1.PostedFile.SaveAs(Server.MapPath(this.tables.SelectedItem.Value+"\\"+id+"\\"+fnm));
this.fileinfo.InnerHtml+=this.tables.SelectedItem.Value+"\\"+id+fnm+"<br>";
}
catch(Exception e1)
{
Response.Write(e1.ToString());
}
解决方案 »
- 支付宝的partner 和可以key可以告诉别人吗?
- 关于GridView绑定时特殊字符
- 页面样式变乱问题
- ???有难度的DropDownList的问题(涉及个人配置的绑定)
- 请教Session的存活周期,谢谢
- 请问isapi的URLrewirte和.net引擎的URLrewirte 在高并发高访问量的服务器上哪个效率更高?
- 怎样对数据库加密?还有用DB5对一字符加密后怎样读出原来的内容?
- 谁能发我一份dhtmlxgrid批量更新的实例
- 怎么在DataGrid中实现点击标题在新窗口中显示这条记录的所有字段?
- 十万火急。我在日历控件的网格中加入了HyperLink控件,我用什么方法触发这个HyperLink的点击事件???
- window.open "Main.aspx","","scrollbars=no,status=no"可以打开一个没有状态栏和滚动条的window,可是打开的window怎么去掉状态栏和滚动
- vb.net中怎样将dropdownlist.SelectedItem.Value值转化为整数??
asp自带的不就是smtp吗?
是这样的吗?
用自带的不用开smtp服务吗(虽然个人机器上默认是开的)
谢
asp.net不就是通过邮件附件形势上传的嘛
不然怎么会只能4m
我都被弄糊涂了
请高手指教
谢