@{
var dataFile = Server.MapPath("~/App_Data/Persons.txt");
Array userData = File.ReadAllLines(dataFile);
}
<!DOCTYPE html>
<html>
<body>
<h1>从文件中读取数据</h1>
@foreach (string dataLine in userData)
{
foreach (string dataItem in dataLine.Split(','))
{
@dataItem <text> </text>}
<br>
}
</body>
</html>