Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int appId = 123456; // указываем id приложения
- static string password = "test"; // пароль
- static long? _ownerid = -12345678;
- static void Main(string[] args)
- {
- Like();
- }
- static VkApi authVk()
- {
- Settings scope = Settings.All; //ошибка 401
- // Settings scope = Settings.Wall; //Ошибки не будет
- var vk_api = new VkApi();
- vk_api.Authorize(new ApiAuthParams
- {
- ApplicationId = (ulong)appId,
- Login = email,
- Password = password,
- Settings = scope
- });
- return vk_api;
- }
- static void Like ()
- {
- var vk_api = authVk();
- vk_api.Likes.Add(new LikesAddParams
- {
- Type = LikeObjectType.Post,
- ItemId = 5073,
- OwnerId = _ownerid,
- AccessKey = vk_api.Token
- });
- Console.WriteLine("goodlike");
- }
Advertisement
Add Comment
Please, Sign In to add comment