S
sincethe2004
Hi, I'm write an asp to include part of a text file into my asp output html,
I use FileSystemObject to get the content of the text file,
but the asp just hang when it runs,
the source code is listed below if anyone could help:
--------------------
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
if (String(Request.QueryString("page")) == "undefined" ||
String(Request.QueryString("page")) == "")
{
Response.Write("Please specify the page data.");
Response.End()
}
var sFile = Server.MapPath(String(Request.QueryString("page")));
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (!fso.FileExists(sFile)) {
Response.Write("No Such File : " + String(Request.QueryString("page")));
//Response.Redirect(".");
Response.End();
}
var f = fspenTextFile(sFile, 1); //1 -- ForReading
var sFileTxt = f.ReadAll();
f.Close();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<%= sFileTxt %>
</body>
</html>
--------------------
I use FileSystemObject to get the content of the text file,
but the asp just hang when it runs,
the source code is listed below if anyone could help:
--------------------
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
if (String(Request.QueryString("page")) == "undefined" ||
String(Request.QueryString("page")) == "")
{
Response.Write("Please specify the page data.");
Response.End()
}
var sFile = Server.MapPath(String(Request.QueryString("page")));
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (!fso.FileExists(sFile)) {
Response.Write("No Such File : " + String(Request.QueryString("page")));
//Response.Redirect(".");
Response.End();
}
var f = fspenTextFile(sFile, 1); //1 -- ForReading
var sFileTxt = f.ReadAll();
f.Close();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<%= sFileTxt %>
</body>
</html>
--------------------