2011-12-22 50 views
-1

我有三列(0),列(1),列(2),我希望這三行的代碼如下這行代碼:「strNewContents = strNewContents &」「&列(0)&」「 &列(1)& 「」 &列(2)& 「」 & vbcrlf:」如何在經典的asp中使用<a href ></a>?

實際代碼:

Dim strFileName1 
Dim objFSO, objTextFile 
Dim intLineNumber, strNewContents, strReadLineText,strLineNumbers 
dim data, columns 

strFileName1 = "saveimagename.txt" 

Const ForReading = 1 
Const ForWriting = 2 

Set objFSO = CreateObject("Scripting.FileSystemObject") 
Set objTextFile = objFSO.OpenTextFile(Server.MapPath(strFileName1)) 

intLineNumber = 0 
strLineNumbers = "" 

data = split(objTextFile.readall(), vbcrlf) 

for intLineNumber = 0 to ubound(data) 
    columns = split(data(intLineNumber), ",", 3) 
    if (ubound(columns) = 2) then 
     ''//strNewContents = "<td class='red'>" & columns(0) & "</td><td class='blue'>" & columns(2) & "</td>" 
     strNewContents = strNewContents & "<tr><td>" & columns(0) & "</td><td>" & columns(1) & "</td><td>" & columns(2) & "</td></tr>" & vbcrlf 
    end if 
next 
+1

這是我見過的sloppiest代碼。你不使用IDE嗎?什麼會自動更正您的大寫錯誤? – 2011-12-22 06:35:20

回答

5

您已經使用Response.Write與字符串。

您只需:

Response.Write "<a href=""" & link & """>" & linkName & "</a>"

相關問題