我想创建一个通用的记录器类。这抱怨“值不能为空。参数名称:路径”。初始化对象后,我得到 logname 值但没有 log。我哪里做错了?
class Logger
{
public static string log;
public Logger(string logname)
{
log = logname;
}
StreamWriter writer = new StreamWriter(log);
}
我想创建一个通用的记录器类。这抱怨“值不能为空。参数名称:路径”。初始化对象后,我得到 logname 值但没有 log。我哪里做错了?
class Logger
{
public static string log;
public Logger(string logname)
{
log = logname;
}
StreamWriter writer = new StreamWriter(log);
}