public static void Login(string listenerID) { try { webForm = new WebForm(); object missing = System.Type.Missing; object url = CreateLoginUrl(listenerID); webForm.Browser.Navigate2(ref url, ref missing, ref missing, ref missing, ref missing); new Timer(new TimerCallback(FinalizeLogin), null, 1000*15, -1); } catch (Exception ex) { Debug.WriteLine(ex.Message); Debug.WriteLine(ex.StackTrace); } }
// // Public methods // #region public static void Login(string listenerID) public static void Login(string listenerID) { try { webForm = new WebForm(); object missing = System.Type.Missing; object url = CreateLoginUrl(listenerID); webForm.Browser.Navigate2(ref url, ref missing, ref missing, ref missing, ref missing); new Timer(new TimerCallback(FinalizeLogin), null, 1000 * 15, -1); } catch (Exception ex) { Debug.WriteLine(ex.Message); Debug.WriteLine(ex.StackTrace); } }
private static void FinalizeLogin(object state) { try { webForm.Close(); webForm = null; } catch (Exception ex) { Debug.WriteLine(ex.Message); Debug.WriteLine(ex.StackTrace); } }