.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> VBScript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Viewing .txt Files using VBScript

Posted By:Athira Sreejith       Posted Date: April 07, 2009    Points: 10    Category: VBScript    URL: http://www.dotnetspark.com  
 

 

Viewing .txt Files using  VBScript

 

<%@ Language=VBScript %>





<%
dim orderid,order
dim fs,wfile ,filecontent,FileToRead
dim strSecurefileName,filename,counter
strSecurefileName = "D:\SSL\tomdickins"
orderid=Request.QueryString("orderid")
order="order_" & orderid&".txt"
filename=strSecurefileName&"\"&order
 set fs=server.CreateObject("Scripting.FileSystemObject")
 if fs.FileExists(filename) then
   Set wfile = fs.OpenTextFile(filename,1)
   counter=0
   do while not wfile.AtEndOfStream
   counter=counter+1
   singleline=wfile.readline
   response.write ("" &  singleline & "
")
 loop
  wfile.close
  Set wfile=nothing
  Set fs=nothing
  else
  Response.Write "File Does Not Exists"
 end if
%>
Order details



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend