我intrested如果我用使用嘗試捕捉內部(即關閉所有連接)如果失敗,是否使用關閉連接?
try{
using (var browser = new IE("https://www.bbvanetcash.com/local_kyop/KYOPSolicitarCredenciales.html"))
{
clsUtils.WriteToLog("Trying to login", true, true);
browser.Visible = false;
browser.TextField(Find.ByName("cod_emp")).Value = _company;
browser.TextField(Find.ByName("cod_usu")).Value = _strUser;
browser.TextField(Find.ByName("eai_password")).Value = _strPass;
browser.Button(Find.ByClass("grandote estirado azul")).Click();
browser.WaitForComplete();
clsUtils.WriteToLog("Logged ", true, true);
connected = true;
var cookie = browser.Eval("document.cookie");
CookieContainer Cc = GetCc(cookie);
} catch (Exception ex)
{
Console.WriteLine("(TryToLogin)-->Catching the {0} exception .", ex.GetType());
return connected;
}
}
,如果步驟一個戈納的使用會關閉連接或只是戈納去捕捉失敗?