Gary Williams
10-21-2005, 01:07 PM
Hi All,
I have written a simple vbs script that itself write a text file containing asp code. Here it is:
-----------------------------------
Dim oFSO
Dim oFile
Dim strLine
Dim strLoginFile
Dim strAgentRef
strAgentRef = 9997
strLoginFile = "d:\websites\test\www\dca\login" & strAgentRef & ".asp"
set oFSO = createobject ("scripting.filesystemobject")
set oFile = oFSO.createtextfile("" & strLoginFile & "",true)
strLine="<% response.cookies(""enabled"")=""1"" "
strLine=strLine & vbCrLf
strLine=strLine & "response.redirect(""login" & stragentref & "2.asp"")%>"
oFile.writeline strLine
oFile.close
set oFile = nothing
set oFSO = nothing
--------------------------------------
This works fine and correctly produces the following code:
<% response.cookies("enabled")="1"
response.redirect("login99972.asp")%>
However, when I try to convert this script to an asp file, the " %> " causes a problem. I need to be able to tell the file that, in this case, this " %> " is to be treated as text only and not an end if statement.
I guess this is to do with those multiple single and double quotes again?
Regards
Gary
I have written a simple vbs script that itself write a text file containing asp code. Here it is:
-----------------------------------
Dim oFSO
Dim oFile
Dim strLine
Dim strLoginFile
Dim strAgentRef
strAgentRef = 9997
strLoginFile = "d:\websites\test\www\dca\login" & strAgentRef & ".asp"
set oFSO = createobject ("scripting.filesystemobject")
set oFile = oFSO.createtextfile("" & strLoginFile & "",true)
strLine="<% response.cookies(""enabled"")=""1"" "
strLine=strLine & vbCrLf
strLine=strLine & "response.redirect(""login" & stragentref & "2.asp"")%>"
oFile.writeline strLine
oFile.close
set oFile = nothing
set oFSO = nothing
--------------------------------------
This works fine and correctly produces the following code:
<% response.cookies("enabled")="1"
response.redirect("login99972.asp")%>
However, when I try to convert this script to an asp file, the " %> " causes a problem. I need to be able to tell the file that, in this case, this " %> " is to be treated as text only and not an end if statement.
I guess this is to do with those multiple single and double quotes again?
Regards
Gary