public static void Login(Wiki wiki, string username, string password, string fileName) { if (!WikiCache.LoadCookies(wiki, fileName)) { wiki.Login(username, password); WikiCache.CacheCookies(wiki, fileName); } else { wiki.Login(); if (!wiki.IsBot) { wiki.Logout(); wiki.Login(username, password); WikiCache.CacheCookies(wiki, fileName); } } }