私はクラスのプロジェクトに取り組んでいます。私がしなければならないことは、解析された命令をファイルにエクスポートすることです。Microsoft には、ファイルへの書き込み方法を説明する次の例があります。
// Compose a string that consists of three lines.
string lines = "First line.\r\nSecond line.\r\nThird line.";
// Write the string to a file.
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
file.WriteLine(lines);
file.Close();
その部分は問題ありませんが、ファイルを現在のプロジェクトの環境/場所に書き込む方法はありますか? 特定のパス(つまり)をハードコーディングする代わりに、それを行いたいと思い"C:\\test.txt"
ます。