111,126
社区成员
发帖
与我相关
我的任务
分享
StreamWriter sr;
if (File.Exists(文件名))
{
if (DialogResult.OK == MessageBox.Show("目录下已存在该文件,\n是否删除原有文件?", "系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1))
{
File.Delete(文件名);//删除远文件
}
else
{
return;
}
}
sr = File.CreateText(文件名);
sr.Close();System.IO.File.Exists(xmlFilePath);