using System; using System.Collections.Generic; using System.Text; using System.Threading; using SKYPE4COMLib; namespace AutoSkypeMessager { class Program { static void Main(string[] args) { SkypeClass skype = new SkypeClass(); Chat c; TimeSpan tsp; skype.Attach(5, true); tsp = new TimeSpan(0, 0, 0, 0, 99); while (true) { try { //System.Diagnostics.Debug.WriteLine(Properties.Settings.Default.Time - DateTime.Now); if ((Properties.Settings.Default.Time - DateTime.Now) <= tsp) { foreach (string chat in Properties.Settings.Default.Chats.Split(',')) { c = skype.get_Chat(chat); c.SendMessage(Properties.Settings.Default.Message); } Console.WriteLine("Time!"); Console.Read(); return; }else{ Console.WriteLine(Properties.Settings.Default.Time - DateTime.Now); } } catch (Exception e) { Console.WriteLine("Error: {0}", e.Message); } Thread.Sleep(100); } } } }