protected void LoadUserManagementData()
        {
            var    credentials = GetCredentialsFrom(User.Identity.Name);
            string path        = string.Format(
                options.AlbaUserManagementHtmlPath,
                credentials.AlbaAccountId);

            if (io.File.Exists(path))
            {
                io.File.Delete(path);
            }

            var client = AuthClient();

            client.Authenticate(credentials);

            var json = client.DownloadString(
                RelativeUrlBuilder.GetUserManagementPage());

            string html = AlbaJsonResultParser.ParseDataHtml(json, "users");

            if (!io.Directory.Exists(io.Path.GetDirectoryName(path)))
            {
                io.Directory.CreateDirectory(io.Path.GetDirectoryName(path));
            }

            io.File.WriteAllText(path, html);
        }
Пример #2
0
        public void SaveAs(string fileName)
        {
            var html = client.DownloadString(
                RelativeUrlBuilder.GetUserManagementPage());

            List <AlbaHtmlUser> users = GetUsers(html);
        }