ASP类需要紧急帮助 [英] Class ASP Need Urgent Help

查看:101
本文介绍了ASP类需要紧急帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请查看以下代码-

Pl review following code-

Function FileProperties( sFileName, sLength, sDateTime, sAttr)
    dim oFS, oFile
    Set oFS = Server.CreateObject("Scripting.FileSystemObject")

    if ( oFS.FileExists( sFileName ) ) then
        set oFile = oFS.GetFile( sFileName )
        sLength = oFile.size
        sDateTime = oFile.DateLastModified
        sAttr = oFile.Attributes

        set oFile = Nothing
        FileProperties = true
    else
        ' might be a folder
        if ( oFS.FolderExists( sFileName ) ) then
            set oFile = oFS.GetFolder( sFileName )

            sLength =  oFile.size 
            sDateTime = oFile.DateLastModified
            sAttr = oFile.Attributes

            set oFile = Nothing
            FileProperties = true
        else
            FileProperties = false
        end if
    end if

    set oFS = Nothing
end Function

Function FileReadLine( oFile, sLineOfFile )
    if not oFile.AtEndOfStream then
        sLineOfFile = oFile.ReadLine()
        FileReadLine = true
    else
        FileReadLine = false
    end if

end Function


使用以上两个功能,我想从文件中读取内容,
所以我写了以下脚本-


Using above to two function, I want to read content from file,
so I wrote following script -

Dim fs1, fs2, fs3

sFileName = server.mappath("/db/remoteinfo.txt")
call FileProperties( sFileName, sLength, sDateTime, sAttr)

response.write "Length -  " & sLength 

call FileReadLine(oFile, sLineOfFile)


在这里我得到错误消息:
Microsoft VBScript运行时错误''800a01a8''

所需对象:"oFile"

请紧急帮助我.


在此先感谢....


Here I get error message :
Microsoft VBScript runtime error ''800a01a8''

Object required: ''oFile''

Please help me as it is very urgent.


Thanks in advance....

推荐答案

您尚未发布任何称为FileReadLine的地方,但我想您没有将其传递给它,或者它没事.

ASP是一场噩梦,我将以最快的速度从该项目中运行.
You have not posted anywhere that you call FileReadLine, but I am guessing that you didn''t pass it in, or it''s Nothing.

ASP is a nightmare, I would run from this project as fast as you can.


这篇关于ASP类需要紧急帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆