如何在asp中获取这两个值?

时间:2011-08-19 14:14:59

标签: file-io vbscript asp-classic

如何读取两个值,txt文件中的一行?

value1,value2

set nesne = Server.CreateObject("Scripting.FileSystemObject")   

Response.Write "Son 10 Kayıt<br/>"

Const nLines = 10
set AO = nesne.OpenTextFile(Server.MapPath("log.txt"),8)
NumberOfRecords = AO.Line - 1
AO.Close

set AO = nesne.OpenTextFile(Server.MapPath("log.txt"),1)
For j = 1 To NumberOfRecords - nLines
    s = AO.SkipLine
Next

'You could put the rest into an Array
'v = Split((f.readall), vbLf)

For j = 1 To nLines
    Response.Write AO.ReadLine 
    Response.Write "<br/>"
Next

AO.Close

1 个答案:

答案 0 :(得分:0)

您可以使用:

arrayVariable = Split(strLine,",")

这将采用strLine中的任何内容(应该是您刚读入的行)并使用','作为分隔符将其保存到数组(arrayVariable)。