如何从一个网站看? C#(How can I read from a website? C#)

.NET Framework IT屋
问 题

I'm trying to make a bot, how can I read the value like the 1800 / 1800 from a website?

enter image description here

        Console.WriteLine("Health: ")
        Console.WriteLine("Energy: ")
        Console.WriteLine("Cash: ")
        Console.WriteLine("Level: ")

I'm making a console application, trying to get the value. Like if the health is lower then 1000/1800 then it's going to execute a send key. Like send the key "0" to the website.

Thanks, Prince

解决方案

trying using WebClient.DownloadString

http://msdn.microsoft.com/en-us/library/system.net.webclient.downloadstring(v=vs.110).aspx

WebClient client = new WebClient ();
string reply = client.DownloadString ("http://google.com");

you then parse the document for the things you want. you can use the HTML Agility pack for that

http://htmlagilitypack.codeplex.com/

本文地址:IT屋 » How can I read from a website? C#

问 题

我试图让一个机器人,我如何从一个网站读起来就像1800年/ 1800年的价值?

  Console.WriteLine(“健康”)
        Console.WriteLine(“能源”)
        Console.WriteLine(“现金”)
        Console.WriteLine(“等级”)

我在做一个控制台应用程序,试图获得的价值。如果健康就好低则1800分之1000然后它会执行一个发送键。像发送键“0”的网站。

谢谢,王子


解决方案

试图使用 WebClient.DownloadString

http://msdn.microsoft.com/en-us/library/system.net.webclient.downloadstring(v=vs.110).aspx

  Web客户端的客户端=新的WebClient();
串答复= client.DownloadString(“http://google.com”);

您解析,然后为你想要的东西的文档。您可以使用HTML敏捷包为

HTTP://htmlagilitypack.$c$cplex.com/

本文地址:IT屋 » 如何从一个网站看? C#