请高手赐教,关于server对像的简单问题
<%@ page language="vb" %>
<html>
<body>
<%
dim x
dim y
dim c
x=Server.createobject("Scripting.FilesystemObject")
y=x.opentextfile("e:dwnet/number.txt",1)
c=y.readline
c=c+1
y.close
y=x.opentextfile("e:dwnet/number.txt",2)
y.writeline(c)
y.close
y=nothing
x=nothing
%>
</body>
</html>
为什么上面那个程序一运行就会显示错误
Server Error in '/' Application.
Exception from HRESULT: 0x800A003E.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.EndOfStreamException: Exception from HRESULT: 0x800A003E.
Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration> <system.web> <compilation debug="true"/> </system.web> </configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. |
Stack Trace:
[EndOfStreamException: Exception from HRESULT: 0x800A003E.]
Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +899
ASP.number_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) +186
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Page.ProcessRequestMain() +1929
|
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573