asp教程.net读写txt文件实例
<%@ page language="vb" %>
<html>
<head>
<title>unload event example</title>
<script runat="server">
dim thefile as system.io.streamreader
sub page_load()
thefile = system.io.file.opentext(mappath("file.txt"))
message.text = "<pre>" & _
server.htmlencode(thefile.readtoend()) & "</pre>"
end sub
sub page_unload()
thefile.close()
end sub
</script>
</head>
<body>
<asp:label id="message" runat="server"/>
</body>
</html>
时间: 2024-10-23 18:38:00