asp教程.net c#(htmlinputfile)上传图片代码
先看一下htmlinputfile文件上传功能
httpfilecollection files = httpcontext.current.request.files;
if ( files.count == 1 )
{
httppostedfile postedfile = files[0];
if ( postedfile.filename != " " )
{
string filename = path.getextension(postedfile.filename);
string savepath = "/upload/ " + filename;
try
{
postedfile.saveas(savepath);
}
catch
{
this.showmessage( "上传照片失败! ");
throw;
}
}
}
下面一款应用实例
language="c#" %>
%@import namespace="system.io"%>
%@import namespace="system.data"%>
%@import namespace="system.data.sqlclient"%>
| 上传图片 |
|
| 文件说明 |
|
|
|
|
//显示图片
%@page language="c#"%>
%@import namespace="system.data"%>
%@import namespace="system.data.sqlclient"%>
tplink路由器默认密码是多少(tplink路由器默认密码详解)
tplink路由器默认密码怎么查看(tplink路由器默认密码查看方法)
tplink无线路由器密码怎么重置(tplink无线路由器密码重置方法)
手机如何设置tplink无线路由器密码和密码共享功能(手机设置tplink无线路由器密码和密码共享功能方法)
tplink无线路由器密码忘记了怎么办(tplink无线路由器密码忘记了解决方案)
tplogin路由器可以无线桥接么(TPLink路由器是否支持无线桥接功能)