<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