You are able to get stream reader of a file and work on stream reader.
After getting Stream Reader and completing work on stream reader you have to close SteramReader using Close method. to avoid any file open errors.
Here are example for this.
C# Example :
VB.net Example :
Here in below image you can see that after FileStream Object is filled it's properties are set.
Output :
After getting Stream Reader and completing work on stream reader you have to close SteramReader using Close method. to avoid any file open errors.
Here are example for this.
C# Example :
System.IO.StreamReader objStreamReader = System.IO.File.OpenText(MapPath("TextFile.txt"));
objStreamReader.Close();
VB.net Example :
Dim objStreamReader As System.IO.StreamReader = System.IO.File.OpenText(MapPath("TextFile.txt")) objStreamReader.Close()
Here in below image you can see that after FileStream Object is filled it's properties are set.
Output :
No comments:
Post a Comment