shanuragu
09-10-2003, 12:07 AM
Hi
I am trying to test whether a text file is empty or not. Here the code for the same.
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTickerFile = objFSO.GetFile(Server.MapPath(".") & "/scrollers/top_scroller.txt")
Set objTextStream = objTickerFile.OpenAsTextStream(ForReading)
strScrollerText = objTextStream.ReadAll
if (strScrollerText <> "")
Response.write("Not Empty")
else
Response.write("Empty")
End if
What is wrong with the above code??
shara
I am trying to test whether a text file is empty or not. Here the code for the same.
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTickerFile = objFSO.GetFile(Server.MapPath(".") & "/scrollers/top_scroller.txt")
Set objTextStream = objTickerFile.OpenAsTextStream(ForReading)
strScrollerText = objTextStream.ReadAll
if (strScrollerText <> "")
Response.write("Not Empty")
else
Response.write("Empty")
End if
What is wrong with the above code??
shara