01.
<%@ Import
Namespace
=
"System.IO"
%>
02.
<%@ Page Language=
"VB"
%>
03.
<script runat=
"server"
>
04.
Sub
Page_Load(sender
As
Object
, e
As
EventArgs)
05.
Dim
StrWer
As
StreamWriter
06.
Try
07.
StrWer = File.CreateText(Server.MapPath(
"MyFiles/"
) &
"thaicreate.txt"
)
08.
StrWer.Write(
"www.ThaiCreate.Com"
)
09.
StrWer.Write(
"Version 2009"
)
10.
StrWer.WriteLine(
""
)
11.
StrWer.WriteLine(
"www.ThaiCreate.Com"
)
12.
StrWer.WriteLine(
"Version 2009"
)
13.
StrWer.Close()
14.
Me
.lblStatus.Text =
"Files Writed."
15.
Catch
ex
As
Exception
16.
Me
.lblStatus.Text =
"Write failed. ("
& ex.Message &
")"
17.
End
Try
18.
End
Sub
19.
</script>
20.
<html>
21.
<head>
22.
<title>ThaiCreate.Com ASP.NET - Write Text Files</title>
23.
</head>
24.
<body>
25.
<form runat=
"server"
>
26.
<asp:Label id=
"lblStatus"
runat=
"server"
></asp:Label>
27.
</form>
28.
</body>
29.
</html>