VK API for .Net

    image
    Good afternoon friends!

    I want to tell you about my small open source project, namely the implementation of the VKontakte API for .Net. In total, I’ve been sawing it for a year and a half. Not everything has been done, but what has been done under the cut.

    A full list of implemented methods can be found in the documentation . Briefly, almost all methods from the following categories:
    • users
    • friends;
    • statuses;
    • posts
    • groups
    • audio
    • video
    • vk data
    • official
    • bookmarks
    • wall (a little).

    A small example of how to work with this. For example, let's try to send a message “hello, friend!” To users from the Habrahabr community (checks removed). This example is shown only to demonstrate the operation of the library.
    static void Main(string[] args)
            {
                int appId = 1234567; // указываем id приложения
                string email = "example@example.ru"; // email для авторизации
                string password = "qwerty123"; // пароль
                Settings settings = Settings.All; // уровень доступа к данным
                var api = new VkApi();
                api.Authorize(appId, email, password, settings); // авторизуемся
                var group = api.Utils.ResolveScreenName("habr"); // получаем id сущности с коротким именем habr
                // получаем id пользователей из группы, макс. кол-во записей = 1000
                int totalCount; // общее кол-во участников
                var userIds = api.Groups.GetMembers(group.Id.Value, out totalCount); 
                foreach (long id in userIds)
                {
                    api.Messages.Send(id, false, "привет, друг!"); // посылаем сообщение пользователю
                }
            }}
    


    You can download it from the project website or download via Nuget .

    image

    PS Many methods have not yet been implemented and if you want to participate in the project or find errors, then let us know about it through the site .

    Only registered users can participate in the survey. Please come in.

    What categories of methods to implement next

    • 39.2% Wall 216
    • 31.4% Photos 173
    • 7.8% Widgets 43
    • 17.6% Pages 97
    • 12% Discussions 66
    • 16.1% Video 89
    • 8.9% Notes 49
    • 9.2% of places 51
    • 24.9% Account 137
    • 22% News 121
    • 26.1% I like 144
    • 13% Polls 72
    • 16% Documents 88
    • 18.1% Notifications 100
    • 17.4% Statistics 96
    • 21% Search 116
    • 26.3% Contact is evil, I do not use it 145

    Also popular now: