public static string Goto(String text, IE ie) { int i = 0; while (i < Loop) { i++; try { ie.GoTo(text); ie.WaitForComplete(); //ie.WaitUntilContainsText("message"); return string.Empty; } catch (Exception ex) { if (i == Loop) { return ex.Message; } ie.Close(); Thread.Sleep(60000); ie.Reopen(); } } return string.Empty; }
public static string Goto(string Url, IE ie) { int i = 0; while (i < Loop) { i++; try { ie.GoTo(Url); ie.WaitForComplete(); return string.Empty; } catch (Exception ex) { if (i == Loop) { return ex.Message; } ie.Close(); Thread.Sleep(60000); ie.Reopen(); } } return string.Empty; }