ขั้นแรก เพิ่มประโยค using ตามด้านล่าง
First, add using statement
- using System.IO.StreamWriter;
ขั้นที่สอง ประกาศและนิยามออบเจ็ค StreamWriter ใหม่ เพื่อเขียนไฟล์ข้อความไปที่ file_path
Second, declare and define new StreamWriter object to write text file at file_path
- StreamWriter file = new StreamWriter(file_path);