<%@Import Namespace="System.IO"%>
<script language="VB" runat="server">
Sub Page_Unload(Sender As object, E As EventArgs)
Dim objStreamWriter As StreamWriter = File.CreateText("c:\a.txt")
objStreamWriter.WriteLine("Hello World")
objStreamWriter.close
End Sub
</script>
run แล้ว ขึ้นว่า
Server Error in '/' Application.
--------------------------------------------------------------------------------
Server Error in '/' Application.
--------------------------------------------------------------------------------
Access to the path "c:\a.txt" is denied.
Date :
27 ก.ย. 2549 13:45:29
By :
ta
No. 3
Guest
ได้แล้วครับ
ตรงบรรทัด Dim objStreamWriter As StreamWriter = File.CreateText("c:\a.txt")
ต้องแก้เป็น Dim objStreamWriter As StreamWriter = File.CreateText("c:\Inetpub\wwwroot\a.txt") ครับ