ASP.NET文件上传程序的源代码
来源:互联网 发布:vms4000监控软件下载 编辑:程序博客网 时间:2024/05/17 21:54
本文件用VB.NET编辑,在WIN2000+IIS(安装有.NET支持)中调试通过,可以上传许多常用的文件类型.如
RAR、ZIP、DOC、TXT、JPG、GIF等等!
直接下载保存为ASPX格式就可以
------------------------------------------------------------
<html>
<title>文件上传</title>
<body>
<form enctype="multipart/form-data" runat=server>
<Input type=file id=fileup runat=server size="20"><p>
<asp:button id=upload_button onclick=uploadfile text="上传" runat=server/>
</form>
<p>
<asp:label id=uptype runat=server/>
</body>
</html>
<title>文件上传</title>
<body>
<form enctype="multipart/form-data" runat=server>
<Input type=file id=fileup runat=server size="20"><p>
<asp:button id=upload_button onclick=uploadfile text="上传" runat=server/>
</form>
<p>
<asp:label id=uptype runat=server/>
</body>
</html>
<script language=VB runat=server>
Sub uploadfile()Sub uploadfile(sender as object,e as eventargs)
If fileup.postedfile.contentlength=0 Then
uptype.text="你还没有选择需要上传的文件!"
Else
Dim filesplit() as string=split(fileup.postedfile.filename,"")
Dim filename as string=filesplit(filesplit.length-1)
fileup.postedfile.saveas(server.mappath(".")&""&filename)
uptype.text="文件名称:"&fileup.postedfile.filename &"<br>"& _
"文件大小:"&fileup.postedfile.contenttype &"<br>"& _
"文件类型:"&fileup.postedfile.contentlength
End If
End Sub
</script>
Sub uploadfile()Sub uploadfile(sender as object,e as eventargs)
If fileup.postedfile.contentlength=0 Then
uptype.text="你还没有选择需要上传的文件!"
Else
Dim filesplit() as string=split(fileup.postedfile.filename,"")
Dim filename as string=filesplit(filesplit.length-1)
fileup.postedfile.saveas(server.mappath(".")&""&filename)
uptype.text="文件名称:"&fileup.postedfile.filename &"<br>"& _
"文件大小:"&fileup.postedfile.contenttype &"<br>"& _
"文件类型:"&fileup.postedfile.contentlength
End If
End Sub
</script>
- ASP.NET文件上传程序的源代码
- ASP.NET文件上传程序的源代码
- ASP.NET文件上传程序的源代码
- asp.net上传文件的源代码
- asp.net上传文件的源代码
- ASP.NET文件的上传
- asp.net中实现多文件上传界面源代码
- asp.net中实现多文件上传C#源代码
- ASP.NET程序中常用的源代码
- ASP.NET程序中常用的源代码
- 用asp.net编写的上传程序
- asp.net文件上传
- ASP.Net文件上传
- ASP.Net文件上传
- ASP.NET上传文件
- asp.net文件上传
- ASP.NET上传文件
- Asp.Net 文件上传
- GridView排序
- DataGrid的打印预览和打印
- New-Service 帮助信息
- C# 读取计算机CPU,HDD信息
- Asp.Net中文本换行
- ASP.NET文件上传程序的源代码
- ASP.NET程序中实现校验码图像生成
- asp.net常用函数表
- SQL Server 2005 管理对象
- 标准模板库(STL)介绍
- 快速排序在多核中提高效率
- 你为什么在Windows桌面右键菜单上狂点“刷新”?
- 学习来了
- 邮件实名制--看上去很美