<%@ Import Namespace="System.IO"%> <%@ Page Language="VB" %> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) Dim StrWer As StreamWriter Try StrWer = File.CreateText(Server.MapPath("MyFiles/") & "thaicreate.txt") StrWer.Write("www.ThaiCreate.Com") StrWer.Write("Version 2009") StrWer.WriteLine("") StrWer.WriteLine("www.ThaiCreate.Com") StrWer.WriteLine("Version 2009") StrWer.Close() Me.lblStatus.Text = "Files Writed." Catch ex As Exception Me.lblStatus.Text = "Write failed. ("& ex.Message &")" End Try End Sub </script> <html> <head> <title>ThaiCreate.Com ASP.NET - Write Text Files</title> </head> <body> <form runat="server"> <asp:Label id="lblStatus" runat="server"></asp:Label> </form> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท