示例#1
0
 public static void GetGroupInfoTest()
 {
     try
     {
         var fc = new FacebookClient(UserId, Password);
         var gi = fc.GetGroupInfo("529073513939720");
         Console.WriteLine("Group id : " + gi.Id);
         Console.WriteLine("Group name : " + gi.Name);
         Console.WriteLine("Group members : ");
         Console.WriteLine(string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0,-20} | {1,-10} | {2, -30} |", "User Id", "Is admin", "Display name"));
         gi.Members.ToList().ForEach(member =>
         {
             var display = string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0,-20} | {1,-10} | {2, -30} |", member.UserId, member.IsAdmin, member.DisplayName);
             Console.WriteLine(display);
         });
     }
     catch (Exception ex)
     {
         Console.WriteLine("Message : " + ex.Message);
         Console.WriteLine("StackTrace : " + ex.StackTrace);
         Console.WriteLine("TargetSite : " + ex.TargetSite);
         Console.WriteLine("Source : " + ex.Source);
     }
 }