In this app, im uploading a file, then reading the file using StreamReader, then i wish to delete the file afterwards (as another file with the same name might be uploaded again).
This is the method that reads the file uploaded:
Dim sr As StreamReader = New StreamReader(fname)
Dim lines As Integer = linecount(fname)
Dim x As Integer = 0
Do While x <= lines
Dim array As String = sr.ReadLine
sr = Nothing
right after that i wish to delete the file but when i do, it says that the file is being used by another process. How can i kill the process so that i can access that file again? i tried closing streamreader using sr.Close(), but that did nothing.
Thanks in advance