コード例 #1
0
 public SkypeExample()
 {
     _skype = new SkypeClass();
     _skype.MessageStatus += OnMessage;
     _skype._ISkypeEvents_Event_AttachmentStatus += OnAttach;
     _skype.Attach(7, false);
 }
コード例 #2
0
        public void Skype_AttachmentStatus(TAttachmentStatus status)
        {
            _blnAttached = false;

            // DEBUG: Write Attachment Status to Window
            //WriteToLog("Attachment Status: " + cSkype.Convert.AttachmentStatusToText(status));
            //WriteToLog(" - " + status.ToString() + Environment.NewLine);

            if (status == TAttachmentStatus.apiAttachAvailable)
            {
                try
                {
                    // This attaches to the Skype4COM class statement
                    _clsSkype.Attach(7, true);
                }
                catch (Exception)
                {
                    // All Skype Logic uses TRY for safety
                }
            }
            else
            if (status == TAttachmentStatus.apiAttachSuccess)
            {
                try
                {
                    System.Windows.Forms.Application.DoEvents();
                    _objSkype.Attach(7, false);
                }
                catch (Exception)
                {
                    // All Skype Logic uses TRY for safety
                }

                _blnAttached    = true;
                _blnWasAttached = true;

                // If we have a queued Silent Mode request, We are attached, process it now
                if (_blnPendingSilentModeStartup)
                {
                    _blnPendingSilentModeStartup = false;
                    try
                    {
                        if (!_objSkype.SilentMode)
                        {
                            _objSkype.SilentMode = true;
                        }
                    }
                    catch (Exception)
                    {
                        // All Skype Logic uses TRY for safety
                    }
                }
            }
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            ISkype skype = new SkypeClass();

            skype.Attach(5, true);
            int count = skype.Chats.Count;

            textBox1.Text = "Count: " + count + "\r\n";
            foreach (IChat chat in skype.Chats)
            {
                textBox1.Text += "\r\n" + chat.FriendlyName;
            }
        }
コード例 #4
0
        static void Main(string[] args)
        {
            SkypeClass _skype = new SkypeClass();

            _skype.Attach(7, false);

            IEnumerable <SKYPE4COMLib.User> users = _skype.Friends.OfType <SKYPE4COMLib.User>();

            users
            .Where(u => u.OnlineStatus == TOnlineStatus.olsOnline)
            .OrderBy(u => u.FullName)
            .ToList()
            .ForEach(u => Console.WriteLine("'{0}' is an online friend.", u.FullName));

            Console.ReadKey();
        }
コード例 #5
0
        public Skype4ComWrapper()
        {
            // Start up our application
            WriteToLog("Starting SafeSkype plugin v1.0");
            WriteToLog();

            // Attach to Skype
            WriteToLog("Attaching to Skype");
            this._objSkype = new Skype();

            // Set up the event handlers
            WriteToLog("Attaching to Skype events");
            _clsSkype = new SkypeClass();
            _clsSkype._ISkypeEvents_Event_AttachmentStatus += new _ISkypeEvents_AttachmentStatusEventHandler(Skype_AttachmentStatus);
            _clsSkype._ISkypeEvents_Event_ConnectionStatus += new _ISkypeEvents_ConnectionStatusEventHandler(Skype_ConnectionStatus);

            _objSkype.MessageStatus             += new _ISkypeEvents_MessageStatusEventHandler(Skype_MessageStatus);
            _objSkype.CallStatus                += new _ISkypeEvents_CallStatusEventHandler(Skype_CallStatus);
            _objSkype.FileTransferStatusChanged += new _ISkypeEvents_FileTransferStatusChangedEventHandler(Skype_FileTransferStatusChanged);

            //_objSkype.Client.CreateMenuItem("menu1", TPluginContext.pluginContextChat, "Example menu", "Example menu hint", "", true, TPluginContactType.pluginContactTypeAll, false);
            //_objSkype.Client.CreateEvent("event1", "example plugin is running", "click here to stop the example");

            try
            {
                // Attach to Skype4COM
                _clsSkype.Attach(7, false);
            }
            catch (Exception)
            {
                // All Skype Logic uses TRY for safety
            }

            try
            {
                if (!_objSkype.Client.IsRunning)
                {
                    _objSkype.Client.Start(false, true);
                }
            }
            catch (Exception)
            {
                // All Skype Logic uses TRY for safety
            }
        }
コード例 #6
0
ファイル: FrmMain.cs プロジェクト: stamepicmorg/SKYPE_Flooder
        private void AttackProcess()
        {
            var skype = new SkypeClass(); //skype

            string target = "", message = "";
            int delay = 0, floodType = 0, protocol = 0;
            Invoke((Action) (() =>
            {
                target = txt_target.Text;
                message = txt_flood_text.Text;
                delay = Convert.ToInt32(nud_delay.Value)*1000;
                floodType = rb_infinite_messages.Checked ? 0 : rb_timeout_messages.Checked ? 1 : 2;
                protocol = Convert.ToInt32(skype_protokol.Value);
            }));
            if (message.Length == 0)
            {
                Invoke((Action) (() => Attacking = false));
                return;
            }
            skype.Attach(protocol, false);
            if (floodType == 2)
            {
                try
                {
                    skype.SendMessage(target, message);
                    Invoke((Action) (() => Attacking = false));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
                return;
            }

            while (Attacking)
            {
                try
                {
                    skype.SendMessage(target, message);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex);
                }
                if (floodType == 1 && delay > 0)
                    Thread.Sleep(delay);
            }
        }
コード例 #7
0
ファイル: FrmMain.cs プロジェクト: stamepicmorg/SKYPE_Flooder
 private void on_load(object sender, EventArgs e)
 {
     try
     {
         Skype skype = new SkypeClass(); //skype
         skype.Attach(Convert.ToInt32(skype_protokol.Value), false);
         var r = new Regex(@"xmpp\:.*");
         foreach (var friend in skype.Friends.Cast<User>().Where(friend => !r.IsMatch(friend.Handle)))
         {
             list_users.Items.Add(new SkypeFriends
             {
                 SUser = friend
             });
         }
     }
     catch
     {
         new FrmMessage().ShowDialog();
     }
 }