<html>
<script language="VB" runat="server">
Sub UploadBtn_Click(Sender as Object, E as EventArgs)
UploadFile.PostedFile.SaveAs(Server.MapPath("chunfeng.jpg"))
MyImage.ImageUrl = "chunfeng.jpg"
MyImage.Visible = true
End Sub
</script>
<head>
<title>星河影動之最簡單的上傳文件</title>
</head>
<body>
<form enctype="multipart/form-data" runat="server">
<h3>請選擇上傳的文件: <input id="UploadFile" type="file" runat="server"> <asp:button Text="上傳文件" onClick="UploadBtn_Click" runat="server/"> </h3>
<hr>
<asp:image id="MyImage" Visible="false" runat="server/">
</form>
</body></html>
[1]