private void button1_Click(object sender, EventArgs e)
{
FileStream fi;
try
{
fi = File.Create(textBox1.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
byte[] content = new UTF8Encoding(true).GetBytes(textBox2.Text);
try
{
fi.Write(content, 0, content.Length);
fi.Flush();
MessageBox.Show("保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
fi.Close();
}
错误提示是没有跟fi局部变量赋值!可是上面有跟他赋值啊,我不懂了