Advertisement
Guest User

Untitled

a guest
Oct 18th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using VkNet;
  3. using VkNet.Enums.Filters;
  4. using VkNet.Model.RequestParams;
  5. using VkNet.Model.Attachments;
  6. using System.Collections.Generic;
  7.  
  8. namespace AndreLesson
  9. {
  10.     class MainClass
  11.     {
  12.         public static void Main (string[] args)
  13.         {
  14.             VkApi api = new VkApi ();
  15.  
  16.             api.Authorize (new ApiAuthParams{
  17.                 ApplicationId = 5511003,
  18.                 Login = "79258772720",
  19.                 Password = "pk1uNd7v",
  20.                 Settings = Settings.All
  21.             });
  22.  
  23.             var user = api.Users.Get ((long)api.UserId);
  24.  
  25.             Console.WriteLine (user.FirstName + " " + user.LastName);
  26.             List<MediaAttachment> Attachments = new List<MediaAttachment> ();
  27.             var photo = new Photo ();
  28.             photo.Id = 439451052;
  29.             photo.OwnerId = 148168107;
  30.             Attachments.Add (photo);
  31.  
  32.             var photo2 = new Photo ();
  33.             photo2.Id = 438147537;
  34.             photo2.OwnerId = 148168107;
  35.             Attachments.Add (photo2);
  36.  
  37.             api.Wall.Post (
  38.                 new WallPostParams{
  39.                     OwnerId = (long)api.UserId,
  40.                     Message = "Test",
  41.                     Attachments = Attachments
  42.                 }
  43.             );
  44.  
  45.             Console.ReadLine ();
  46.  
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement