Пример #1
0
        public VkontakteApi(int userId, string token)
        {
            _userId = userId;
            _token = token;

            Users = new UserCategory();
            Database = new DatabaseCategory();
            Wall = new WallCategory();

            CurrentUser = Users.Get(userId, ProfileFields.all);
        }
Пример #2
0
        public User Get(int userId, ProfileFields[] fields = null, NameCase nameCase = NameCase.nom)
        {
            NameValueCollection qs = new NameValueCollection();
            qs["uids"] = userId.ToString();

            if (fields != null)
                qs["fields"] = String.Join(",", from field in fields select field.ToString());

            qs["name_case"] = nameCase.ToString();
            XmlDocument answer = VkResponse.ExecuteCommand("users.get", qs);
            XmlNode usersNodes = answer.SelectSingleNode("response/user");
            User user = new User(usersNodes);
            return user;
        }