Imar and Gonzalo:
Thanks guys for the help. Problem solved.
Below is a small
VB function that uses the current httpcontext properties to get a path to a website file containing the .txt file I need to read. The nice thing about the line using the httpcontext is that it will work wherever on the server, the file winds up.
The purpose of the function is to test that a naughty user does not enter a nasty word in an input text field. I have more functions in a class to test for more bad input, this is for just the nasty words possibility.
Public Function IsBadWord(ByVal sWord As String) As Boolean
Dim bReturnValue As Boolean = False
Dim sBadWordsFilePath As String
sBadWordsFilePath = HttpContext.Current.ApplicationInstance.Server.Map Path("~/App_Data/BadWords.txt")
Dim reader As StreamReader = New StreamReader(sBadWordsFilePath)
Try
Do
If reader.ReadLine = sWord Then
bReturnValue = True
Exit Do
End If
Loop Until reader.Peek = -1
Catch ex As Exception
Finally
reader.Close()
End Try
Return bReturnValue
End Function
------------------------
Thanks again.
VictorVictor