111,097
社区成员




string path = @"G:\1.txt";//读取文件txt
List<string> list = new List<string>();
using (FileStream fs = new FileStream(path, FileMode.Open))
{
using (StreamReader sr = new StreamReader(fs))
{
while (!sr.EndOfStream)
{
string sLine = sr.ReadLine();
if (sLine.Length < 1)
{
continue;
}
string[] test1 = sLine.Split(',');
if (test1[1].ToString() == "192.168.1.118")
{
//删除此行
}
}
}
}