如何从一个网站看? C# [英] How can I read from a website? C#

查看:342
本文介绍了如何从一个网站看? C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

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.

谢谢,王子

推荐答案

试图使用 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");

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

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

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

这篇关于如何从一个网站看? C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆