Mọi người cho em hỏi em có đoạn code sau, dùng để tìm trong page source những từ có trong file txt, nếu không tìm được từ nào thì refresh, nếu tìm được thì gán giá trị vô array, nhưng lúc chạy thì nó mở trang lên rồi đứng luôn ạ?
string path = @"D:\Copy.txt";//Application.StartupPath + "\\datafile.txt"
System.IO.StreamReader file = new System.IO.StreamReader(path);
string pageSource = drv.PageSource;
string[] n = new string[13];
do
{
for (int i = 0; i < 12; i++)
{
string a = File.ReadLines(path).Skip(i + 1).Take(1).First();
if (pageSource.IndexOf(a) > 0)
{
n[i] = File.ReadLines(path).Skip(i + 1).Take(1).First();
}
}
drv.Navigate().Refresh();
} while (n[1]== "");