TextWriter tw = new StreamWriter("d:\file.txt"); try
{
FileStream str1 = new FileStream(txtPath.Text, FileMode.Open, FileAccess.ReadWrite);
StreamReader strreader1 = new StreamReader(str1);
FileStream str2 = new FileStream(txtPath2.Text, FileMode.Open, FileAccess.ReadWrite);
StreamReader strreader2 = new StreamReader(str2);
List<string> list = new List<string>();
string strf1 = "";
List<string> listf2 = new List<string>();
string strf2 = "";
while ((strf1 = strreader1.ReadLine()) != null)
{
list.Add(strf1);
try
{
while ((strf2 = strreader2.ReadLine()) != null)
{
listf2.Add(strf2);
if (strf1 == strf2)
{
MessageBox.Show(strf1 + "این شماره موجود است");
tw.WriteLine(strf1);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
برچسب:
نویسنده: خنج