如何寫入不同類文件?C#StreamWriter,寫入不同類的文件?
public class gen
{
public static string id;
public static string m_graph_file;
}
static void Main(string[] args)
{
gen.id = args[1];
gen.m_graph_file = @"msgrate_graph_" + gen.id + ".txt";
StreamWriter mgraph = new StreamWriter(gen.m_graph_file);
process();
}
public static void process()
{
<I need to write to mgraph here>
}
你可以做到這一點在「N」的方式,不要忘記做正確的方式...(見我的建議;)) – Learner