Guest User

Untitled

a guest
Dec 21st, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. //I get the Response from the HotSpot so I can fill a ViewModel with the
  2. // hidden parameters.
  3. HtmlDocument htmlElement = new HtmlDocument();
  4. responseClass = new HttpRequestResponse("", "https://secure.etecsa.net:8443");
  5.  
  6. htmlElement.LoadHtml(responseClass.SendNautaRequest());
  7. FillaNautaViewModel(htmlElement);
  8. string parms =
  9. String.Format(
  10. "wlanuserip={0}&wlanacname={1}&wlanmac={2}&firsturl={3}&ssid={4}&usertype={5}&gotopage={6}&successpage={7}&loggerId={8}&lang={9}&username={10}&password={11}&CSRFHW={12}",
  11. _nautaViewModel.wlanuserip, _nautaViewModel.wlanacname, _nautaViewModel.wlanmac,
  12. _nautaViewModel.firsturl, _nautaViewModel.ssid, _nautaViewModel.usertype, _nautaViewModel.gotopage,
  13. _nautaViewModel.successpage, _nautaViewModel.loggerId, _nautaViewModel.lang,
  14. "xxx", "xxxx", _nautaViewModel.CSRFHW);
  15. string login = responseClass.Login(parms);
  16.  
  17. htmlElement.LoadHtml(login);
  18. if (htmlElement.DocumentNode.Descendants("script").Any(c => c.ParentNode.Name == "body"))
  19. {
  20. MessageBox.Show(
  21. htmlElement.DocumentNode.Descendants("script")
  22. .First(c => c.ParentNode.Name == "body")
  23. .InnerHtml.Split('"')[1]);
  24. }
  25. else
  26. {
  27. GetLeftTime();
  28. }
Add Comment
Please, Sign In to add comment