StreamReader error.

  • Thread starter Thread starter ext237
  • Start date Start date
E

ext237

Hello.

I am trying to open a filestream using the following code:

Dim myStreamReader As StreamReader = New StreamReader( _

New FileStream("H:\files\file.txt", FileMode.Open), _

System.Text.Encoding.Unicode)


I receive the following error:

"An unhandled exception of type 'System.UnauthorizedAccessException'
occurred in mscorlib.dll

Additional information: Access to the path "H:\files\file.txt" is denied."

Any suggestions? The code is in a VB class that I'm calling from a
different project.

Thanks.
 
Hi,

I had no trouble with your code. Do you have access to that drive as the
user you are currently logged in as?

Bernie Yaeger
 
Back
Top