Exemplo n.º 1
0
 private HtmlDocument GetDeleteDocument(WebClientWithCookies client)
 {
     var content = client.DownloadString(this.GetPackageUrl());
     var document = new HtmlDocument();
     document.LoadHtml(content);
     return document;
 }
Exemplo n.º 2
0
 public void Delete()
 {
     using (var client = new WebClientWithCookies())
     {
         this.PostSignIn(client);
         this.PostDelete(client);
     }
 }
Exemplo n.º 3
0
 private static HtmlDocument GetLogOnDocument(WebClientWithCookies client)
 {
     var content = client.DownloadString(
         "https://www.nuget.org/users/account/LogOn?returnUrl=%2F");
     var document = new HtmlDocument();
     document.LoadHtml(content);
     return document;
 }
Exemplo n.º 4
0
            private HtmlDocument GetDeleteDocument(WebClientWithCookies client)
            {
                var content  = client.DownloadString(this.GetPackageUrl());
                var document = new HtmlDocument();

                document.LoadHtml(content);
                return(document);
            }
Exemplo n.º 5
0
 public void Delete()
 {
     using (var client = new WebClientWithCookies())
     {
         this.PostSignIn(client);
         this.PostDelete(client);
     }
 }
Exemplo n.º 6
0
            private static HtmlDocument GetLogOnDocument(WebClientWithCookies client)
            {
                var content = client.DownloadString(
                    "https://www.nuget.org/users/account/LogOn?returnUrl=%2F");
                var document = new HtmlDocument();

                document.LoadHtml(content);
                return(document);
            }
Exemplo n.º 7
0
 private void PostDelete(WebClientWithCookies client)
 {
     var node = this.GetDeleteDocument(client).DocumentNode
         .SelectNodes("//input[@name='__RequestVerificationToken']").Single();
     var formValues = new List<string>
     {
         "__RequestVerificationToken=" + node.Attributes["Value"].Value,
         "Listed=false"
     };
     client.UploadString(this.GetPackageUrl(), string.Join("&", formValues.ToArray()));
 }
Exemplo n.º 8
0
            private void PostDelete(WebClientWithCookies client)
            {
                var node = this.GetDeleteDocument(client).DocumentNode
                           .SelectNodes("//input[@name='__RequestVerificationToken']").Single();
                var formValues = new List <string>
                {
                    "__RequestVerificationToken=" + node.Attributes["Value"].Value,
                    "Listed=false"
                };

                client.UploadString(this.GetPackageUrl(), string.Join("&", formValues.ToArray()));
            }
Exemplo n.º 9
0
            private void PostSignIn(WebClientWithCookies client)
            {
                var node = GetLogOnDocument(client).DocumentNode
                    .SelectNodes("//input[@name='__RequestVerificationToken']")[1];
                var formValues = new List<string>
                {
                    "__RequestVerificationToken=" + node.Attributes["Value"].Value,
                    "ReturnUrl=/",
                    "LinkingAccount=False",
                    "SignIn.UserNameOrEmail=" + this.nugetPackageInfo.UserId,
                    "SignIn.Password="******"https://www.nuget.org/users/account/SignIn",
                    string.Join("&", formValues.ToArray()));
            }
Exemplo n.º 10
0
            private void PostSignIn(WebClientWithCookies client)
            {
                var node = GetLogOnDocument(client).DocumentNode
                           .SelectNodes("//input[@name='__RequestVerificationToken']")[1];
                var formValues = new List <string>
                {
                    "__RequestVerificationToken=" + node.Attributes["Value"].Value,
                    "ReturnUrl=/",
                    "LinkingAccount=False",
                    "SignIn.UserNameOrEmail=" + this.nugetPackageInfo.UserId,
                    "SignIn.Password="******"https://www.nuget.org/users/account/SignIn",
                    string.Join("&", formValues.ToArray()));
            }