Scripting.FileSystemObject problems

Discussion in 'ASP General' started by PB4FUN, Sep 20, 2003.

  1. PB4FUN

    PB4FUN Guest

    If I comment #2 to #5 no problems.
    If I uncomment #2, #4 and #5 the page hangs.
    Even did not reach the point to uncomment #3
    So, whats wrong. Do i have to alter some serversettings, and if so, what
    should be changed ?

    OS : W2KP/IIS
    CPU PII 350 MHz
    Mem >500 MB

    <%
    Dim objFSO
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Dim objTextStream
    const strFileName = "F:\FileShare\resume.txt"
    const fsoForReading = 1
    If objFSO.FileExists("F:\FileShare\resume.txt") then
    #1
    'The file exists, so open it and output its contents
    Set objTextStream = objFSO.OpenTextFile(strFileName, fsoForReading)
    #2
    Response.Write "" & objTextStream.ReadAll & ""
    #3
    objTextStream.Close
    #4
    Set objTextStream = Nothing
    #5
    Response.Write strFileName & " was found."
    Else
    'The file did not exist
    Response.Write strFileName & " was not found."
    End If

    Set objFSO = Nothing
    %>

    Meindert, MCP
     
    PB4FUN, Sep 20, 2003
    #1
    1. Advertising

  2. Use something less intrusive than Norton.
    http://www.aspfaq.com/2180





    "PB4FUN" <> wrote in message
    news:#...
    > If I comment #2 to #5 no problems.
    > If I uncomment #2, #4 and #5 the page hangs.
    > Even did not reach the point to uncomment #3
    > So, whats wrong. Do i have to alter some serversettings, and if so, what
    > should be changed ?
    >
    > OS : W2KP/IIS
    > CPU PII 350 MHz
    > Mem >500 MB
    >
    > <%
    > Dim objFSO
    > Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    > Dim objTextStream
    > const strFileName = "F:\FileShare\resume.txt"
    > const fsoForReading = 1
    > If objFSO.FileExists("F:\FileShare\resume.txt") then
    > #1
    > 'The file exists, so open it and output its contents
    > Set objTextStream = objFSO.OpenTextFile(strFileName,

    fsoForReading)
    > #2
    > Response.Write "" & objTextStream.ReadAll & ""
    > #3
    > objTextStream.Close
    > #4
    > Set objTextStream = Nothing
    > #5
    > Response.Write strFileName & " was found."
    > Else
    > 'The file did not exist
    > Response.Write strFileName & " was not found."
    > End If
    >
    > Set objFSO = Nothing
    > %>
    >
    > Meindert, MCP
    >
    >
     
    Aaron Bertrand [MVP], Sep 20, 2003
    #2
    1. Advertising

  3. PB4FUN

    Ray at Guest

    Maybe this.
    http://www.aspfaq.com/2180

    Ray at home

    "PB4FUN" <> wrote in message
    news:%...
    > the page hangs.
    >
    > <%
    > Dim objFSO
    > Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
     
    Ray at, Sep 20, 2003
    #3
  4. PB4FUN

    PB4FUN Guest

    Thanx, it works !!!!

    Meindert, MCP

    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > Use something less intrusive than Norton.
    > http://www.aspfaq.com/2180
    >
    >
    >
    >
    >
    > "PB4FUN" <> wrote in message
    > news:#...
    > > If I comment #2 to #5 no problems.
    > > If I uncomment #2, #4 and #5 the page hangs.
    > > Even did not reach the point to uncomment #3
    > > So, whats wrong. Do i have to alter some serversettings, and if so, what
    > > should be changed ?
    > >
    > > OS : W2KP/IIS
    > > CPU PII 350 MHz
    > > Mem >500 MB
    > >
    > > <%
    > > Dim objFSO
    > > Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    > > Dim objTextStream
    > > const strFileName = "F:\FileShare\resume.txt"
    > > const fsoForReading = 1
    > > If objFSO.FileExists("F:\FileShare\resume.txt") then
    > > #1
    > > 'The file exists, so open it and output its contents
    > > Set objTextStream = objFSO.OpenTextFile(strFileName,

    > fsoForReading)
    > > #2
    > > Response.Write "" & objTextStream.ReadAll & ""
    > > #3
    > > objTextStream.Close
    > > #4
    > > Set objTextStream = Nothing
    > > #5
    > > Response.Write strFileName & " was found."
    > > Else
    > > 'The file did not exist
    > > Response.Write strFileName & " was not found."
    > > End If
    > >
    > > Set objFSO = Nothing
    > > %>
    > >
    > > Meindert, MCP
    > >
    > >

    >
    >
     
    PB4FUN, Sep 20, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    2,724
  2. Mark
    Replies:
    0
    Views:
    123
  3. Giorgio Cervati

    Scripting.FileSystemObject

    Giorgio Cervati, Sep 3, 2003, in forum: ASP General
    Replies:
    0
    Views:
    160
    Giorgio Cervati
    Sep 3, 2003
  4. bart plessers

    NTFS-security and Scripting.FileSystemObject

    bart plessers, Oct 22, 2003, in forum: ASP General
    Replies:
    0
    Views:
    129
    bart plessers
    Oct 22, 2003
  5. MeAndI

    Scripting.FileSystemObject

    MeAndI, Nov 4, 2003, in forum: ASP General
    Replies:
    2
    Views:
    158
    MeAndI
    Nov 4, 2003
Loading...

Share This Page