The name 'sr' doesn't exist in current context

后端 未结 3 1782
灰色年华
灰色年华 2021-01-22 04:26

I was following example from microsoft site for reading from text file. They say to do it like this:

class Test
{
    public static void Main()
    {
        try         


        
3条回答
  •  别那么骄傲
    2021-01-22 05:01

    change this:

      using (StreamReader sr = new StreamReader("TestFile.txt"));
    

    to this:

      using (StreamReader sr = new StreamReader("TestFile.txt"))
    

提交回复
热议问题