How to read text file in classic asp

后端 未结 3 1818
迷失自我
迷失自我 2020-12-11 07:18

I am uploading image.While uploading images i am saving image name and the link for that iage in one textfile. like this, abc.jpeg,http://google.com

Now i want to di

3条回答
  •  醉梦人生
    2020-12-11 07:49

    You could try something like this -

    Dim lineData
    Set fso = Server.CreateObject("Scripting.FileSystemObject") 
    set fs = fso.OpenTextFile(Server.MapPath("imagedata.txt"), 1, true) 
    Do Until fs.AtEndOfStream 
        lineData = fs.ReadLine
        'do some parsing on lineData to get image data
        'output parsed data to screen
        Response.Write lineData
    Loop 
    
    fs.close: set fs = nothing 
    

提交回复
热议问题