<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(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