/// <summary>
/// 删除文本文件指定行
/// </summary>
/// <param name="deleteLineIndex"></param>
private void DeleteLine(int deleteLineIndex)
{
StreamReader reader = new StreamReader(PathFile);
string text = reader.ReadToEnd();
reader.Close();
string[] textlines = Regex.Split(text, Environment.NewLine);
StringBuilder str = new StringBuilder();
for (int i = 0; i < textlines.Length; i++)
{
if (i == deleteLineIndex)
continue;
str.AppendLine(textlines[i]);
}
StreamWriter writer = new StreamWriter(PathFile);
writer.Write(str.ToString());
writer.Close();
}