1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Steam4NET;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Steamworks.Load();
  14. ISteamClient008 steamClient;
  15. //ISteamGameServer009 gameserver;
  16. ISteamFriends001 steamFriends;
  17. int pipe;
  18. int user;
  19. steamClient = Steamworks.CreateInterface<ISteamClient008>("SteamClient008");
  20. pipe = steamClient.CreateSteamPipe();
  21. user = steamClient.ConnectToGlobalUser(pipe);
  22. steamFriends = Steamworks.CastInterface<ISteamFriends001>(steamClient.GetISteamFriends(user, pipe, "SteamFriends001"));
  23.  
  24.  
  25.  
  26.  
  27.  
  28. int etc;
  29. etc = steamFriends.GetFriendCount();
  30. ulong[] blargh;
  31. blargh = new ulong[etc];
  32.  
  33.  
  34. Console.WriteLine(etc);
  35. Console.ReadLine();
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. for (int a =0; a < etc - 1; a++)
  43. {
  44. blargh[a] = steamFriends.GetFriendByIndex(a);
  45. //steamFriends.SendMsgToFriend(76561197997948537, EFriendMsgType.k_EFriendMsgTypeChat, "Test");
  46. Console.WriteLine(blargh[a]);
  47.  
  48. try
  49. {
  50. steamFriends.SendMsgToFriend(76561197997948537, EFriendMsgType.k_EFriendMsgTypeChat, "123");
  51. }
  52. catch
  53. {
  54. Console.WriteLine("Failed");
  55. }
  56.  
  57. System.Threading.Thread.Sleep(200);
  58.  
  59.  
  60. }
  61.  
  62.  
  63. Console.ReadLine();
  64.  
  65. }
  66. }
  67. }
  68.