Tips & Tricks for ASP.NET - C#

Google site Search
File Read VB.NET

'Open a file for reading
Dim FILENAME as String = Server.MapPath("Rand.txt")

'Get a StreamReader class that can be used to read the file
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(FILENAME)

'Now, read the entire file into a string
Dim contents as String = objStreamReader.ReadToEnd()

'Set the text of the file to a Web control
lblRawOutput.Text = contents
    
'We may wish to replace carraige returns with <br>s
lblNicerOutput.Text = contents.Replace(vbCrLf, "<br>")
  
objStreamReader.Close()



Arvixe offers ASP.net hosting that's good for testing plugins. Here is a good arvixe review if you want to know more.

Comments
Write Comments
Name  
Email    
Comments  

Other Titles