简体   繁体   English

从应用程序登录网站

[英]Login to website from app

I would like to know more about how to login on a website from a windows form application 我想了解更多有关如何从Windows窗体应用程序登录网站的信息

The site I am trying to login os z8games.com 我正在尝试登录os z8games.com的网站

I used RequestMaker from google chrome to get the post information. 我使用了Google chrome的RequestMaker来获取帖子信息。 The idea is to fetch my clan members data automatically in order to have a nice picture of what is happening 这个想法是自动获取我的战队成员数据,以便对正在发生的事情有一个很好的了解

Can someone help me on this? 有人可以帮我吗?

When I tried getting an XML file from a website which required credentials I used the following: 当我尝试从需要凭据的网站获取XML文件时,使用了以下内容:

 public static void GetFileWithCredentials(string userName, string password, string url)
{

    using (WebClient wc = new WebClient())
    {
        wc.Credentials = new NetworkCredential(userName, password);
        string xml = wc.DownloadString(url);

        XmlDocument tournamentsXML = new XmlDocument();
        tournamentsXML.LoadXml(xml);
    }

}

Hopefully it is of some use for you. 希望它对您有用。 If it's not would it be possible to post an example of what the data you are trying to get looks like? 如果不是这样,则可以发布一个示例,说明您尝试获取的数据是什么样的? I would've commented first but my reputation doesn't seem to allow me! 我会先发表评论,但我的声誉似乎不允许我!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM