public Program(SkypeCredentials authCreds) { this.authCreds = authCreds; mainSkype = new Skype4Sharp.Skype4Sharp(authCreds); Console.WriteLine("[DEBUG]: Logging in with {0}:{1}", authCreds.Username, string.Join("", Enumerable.Repeat("*", authCreds.Password.Length))); mainSkype.Login(); Console.WriteLine("[DEBUG]: Login complete"); mainSkype.messageReceived += MainSkype_messageReceived; mainSkype.contactRequestReceived += MainSkype_contactRequestReceived; Console.WriteLine("[DEBUG]: Events set"); mainSkype.StartPoll(); Console.WriteLine("[DEBUG]: Poll started"); }
public MainForm() { InitializeComponent(); bool loginFlag = false; string user = ""; do { // Get login info from user Login userLogin = new Login(); if (userLogin.ShowDialog() != DialogResult.OK || (userLogin.user == "" || userLogin.pass == "")) { MessageBox.Show("You need to provide credentials to use this program.", "Skype Login Error", MessageBoxButtons.OK); Environment.Exit(-1); } // create credential object Skype4Sharp.Auth.SkypeCredentials creds = new Skype4Sharp.Auth.SkypeCredentials(userLogin.user, userLogin.pass); mainSkype = new Skype4Sharp.Skype4Sharp(creds); if (mainSkype.Login()) { loginFlag = true; user = userLogin.user; } else { MessageBox.Show("Login failed. Please try again.", "Skype Login Error", MessageBoxButtons.OK); } } while (loginFlag == false); mainSkype.messageReceived += OnMessage; skype_botName = user; chatbot = new ChatResponse(); conversation_users = new List <myUser>(); mainSkype.StartPoll(); }