I'm on an ASP.NET 3.5 server. I keep on getting the error "OpenText is not a member of string".
I've imported the System.IO namespace.
I've had this working before on the same server. Google doesn't seem to have anything to say about this error. I'd appreciate any help.
'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>")