我有这门课:
public static class CsvWriter
{
private static StreamWriter _writer = new StreamWriter(@"c:\temp\ssis_list.csv");
public static StreamWriter Writer
{
get { return _writer; }
}
}
Run Code Online (Sandbox Code Playgroud)
这是从另一个类调用的
class Program
{
...
static void GetConnections(string path,string pkgname,string server)
{
_writer.WriteLine(myLine);
}
}
Run Code Online (Sandbox Code Playgroud)
哪个有这个错误
The name '_writer' does not exist in the current context
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?