我正在尝试在C#中从当前用户的应用程序数据文件夹读取文件,但我还在学习阶段,因此我的代码如下:
int counter = 0;
string line;
// Read the file and display it line by line.
System.IO.StreamReader file = new System.IO.StreamReader("c:\\test.txt");
while ((line = file.ReadLine()) != null)
{
Console.WriteLine(line);
counter++;
}
file.Close();
// Suspend the screen.
Console.ReadLine();
但是我不知道要输入什么来确保总是当前用户的文件夹。