Jump to content

Problem with StreamReader


iyeru42

Recommended Posts

Module examscores	Structure Student		Dim firstName As String		Dim lastName As String		Dim phoneNum As String		Dim examAvg As String	End Structure	Dim anStudent As Student	Dim studentInfo As New ArrayList	Sub Main()		readFiles()		writeData()	End Sub	Sub readFiles()		Dim stuFile As New StreamReader("..\student.txt")		Dim tempArray() As String		Do Until stuFile.Peek = -1			tempArray = Split(stuFile.ReadLine, ",")			anStudent.firstName = tempArray(0)			anStudent.lastName = tempArray(1)			anStudent.phoneNum = tempArray(2)			anStudent.examAvg = tempArray(3)		Loop	End Sub	Sub writeData()		Console.WriteLine("Student Grade Report: 11/29/2006")		Console.WriteLine("How to read this screen:")		Console.WriteLine("Name	Grade Average	Grade")		Console.WriteLine(anStudent.firstName & " " & anStudent.lastName & "  :  " & anStudent.examAvg)	End Sub

Dim stuFile As New StreamReader("..\student.txt") says there's a problem:Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.I found out the problem, network drive issues.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...