我正在尝试从项目目录中访问Web根目录的类型文件。目前它只从C:/访问它,如何让它从Web根目录访问该文件。
我希望该文件在types.txt。
项目文件夹中 Dim fs As StreamReader
Dim rdr As FileStream = New FileStream("/types.txt", FileMode.Open, FileAccess.Read)
fs = New StreamReader(rdr)
While Not fs.EndOfStream
Dim line As String = fs.ReadLine() 'reads each line in file
Dim line2 As String = fs.ReadLine() 'reads each line in file
Dim final As String = line + " types at " + line2 + "%"
mortBox.Items.Add(final) 'adds each lines to combo box
'adds values to array list, this will allow the list to grow with new entries to the file
arrayT.Add(line)
arrayR.Add(line2)
End While
rdr.Close() 'closes open file