Results 1 to 4 of 4

Thread: I have problem with GetFile

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    2

    I have problem with GetFile

    Hi all

    I have big problem.

    I install windows2000 Pro and add IIS.
    If ran asp scripts without write the following statement

    set objFile = objFSO.GetFile(Server.Mappath(inFileName))

    is runing ok.

    If i using

    set objFile = objFSO.GetFile(Server.Mappath(inFileName))

    I have white page and my processor is busy

    Plase help me

  2. #2
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671
    Whats the rest of your code.

    Is it looping somewhere?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    2
    this my code

    Dim fso, f, s
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFile(Server.MapPath("alhawi.txt"))
    s = f.Path & "<br>"
    s = s & "Created: " & f.DateCreated & "<br>"
    s = s & "Last Accessed: " & f.DateLastAccessed & "<br>"
    s = s & "Last Modified: " & f.DateLastModified
    ShowFileAccessInfo = s

    without any loop

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    How is this ASP.NET? That is plain old asp. ASP.NET would look more like this:
    VB Code:
    1. Public Function ShowFileAccessInfo(ByVal filename As String) As String
    2.         Dim fpath As String = Server.MapPath(filename)
    3.         Dim f As New IO.FileInfo(fpath)
    4.         Dim s As String
    5.         s = fPath & "<br>"
    6.         s &= "Created: " & f.CreationTime & "<br>"
    7.         s &= "Last Accessed: " & f.LastAccessTime & "<br>"
    8.         s &= "Last Modified: " & f.LastWriteTime
    9.         Return s
    10.     End Function
    11.  
    12. 'syntax
    13. ShowFileAccessInfo("alhawi.txt")

    Although really this should be fillinf a label or something of that nature.
    Last edited by Edneeis; Oct 3rd, 2003 at 04:50 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width