如何在其中添加字符串:
public void Form1_Load(object s, EventArgs e)
{
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "maincode.txt"))) {
sw.WriteLine("00000012{0:yyyyMMdd}{1}{0:HHmmss}", DateAndTime.Now, (new Random()).Next(0, 2) == 0 ? "0010" : "0054");
}
}
我想通过使用字符串来指定位置。有谁知道我如何添加字符串路径而不是System.IO.Path.Combine
?