private void button5_Click(object sender, EventArgs e)
{
bool Process()
{
string filename = DateTime.Now.ToString("yyyyMMddhhmmss");
string[] c = { textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text };
string filePath = "D:\\BKL\\LOG" + DateTime.Now + ".csv";
Write(filePath, c);
return true;
}
void Write(string filePath, string[] content)
{
if (!File.Exists(filePath))
File.Create(filePath).Close();
StreamWriter sw = new StreamWriter(filePath, true, Encoding.UTF8);
for (int i = 0; i < content.Length; i++)
{
sw.Write(content[i] + ",");
}
sw.Write("\r\n");
sw.Flush();
sw.Close();
}
}
按button5按钮把textBox7, textBox8, textBox9, textBoxText 四个表格的数据存在本地
也不报错也不执行 啥问题啊
{
bool Process()
{
string filename = DateTime.Now.ToString("yyyyMMddhhmmss");
string[] c = { textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text };
string filePath = "D:\\BKL\\LOG" + DateTime.Now + ".csv";
Write(filePath, c);
return true;
}
void Write(string filePath, string[] content)
{
if (!File.Exists(filePath))
File.Create(filePath).Close();
StreamWriter sw = new StreamWriter(filePath, true, Encoding.UTF8);
for (int i = 0; i < content.Length; i++)
{
sw.Write(content[i] + ",");
}
sw.Write("\r\n");
sw.Flush();
sw.Close();
}
}
按button5按钮把textBox7, textBox8, textBox9, textBoxText 四个表格的数据存在本地
也不报错也不执行 啥问题啊