GET ALL Skype Friends using skype C # API

Is there a way to get all users to use Skype with C #? Just like I can activate (friends online).

+4
source share
2 answers

First, you must add the SKYPE4COMLib link from the COM link tab in your project, and then make sure your application is built, since x86 will finally try to use this piece of code:

using System; using System.Collections.Generic; using System.Linq; using SKYPE4COMLib; namespace Example { class SkypeExample { 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(); } } } 

Hope this helps.

+6
source

I had some problems with @Ginkas code. I found below code here and it works like a charm. Also, if I remember correctly, I create an instance of Skype() instead of SkypeClass() . If you play, you should only receive your friends with active status. Hope this helps.

  try { for (int i = 0; i < skype.HardwiredGroups.Count; i++) if (skype.HardwiredGroups[i + 1].Type == TGroupType.grpAllFriends) { for (int j = skype.HardwiredGroups[i + 1].Users.Count; j > 0; j--) Console.WriteLine(skype.HardwiredGroups[i + 1].Users[j].Handle); break; } } catch (Exception e) { Console.WriteLine("Display Friends Group Error- Exception Source: " + e.Source + " - Exception Message: " + e.Message); } 
+1
source

Source: https://habr.com/ru/post/1341043/


All Articles