简体   繁体   English

c#(更具体地说是xna)我如何通过http请求xml文件? 不需要支持xbox

[英]c# (more specifically xna) how can i request a xml file via http? Doesnt need to support xbox

So im working on a game in XNA and i need it to get a server list off our site. 所以我正在开发XNA游戏,我需要它从我们的网站上获取服务器列表。

so i just need to do a http request to http://play.feedthezombie.com/?want=servers&enc=xml and get the contest as either a string or xml object. 所以我只需要对http://play.feedthezombie.com/?want=servers&enc=xml做一个http请求,并将比赛作为字符串或xml对象。

any clues? 任何线索?

Use XmlDocument.Load method. 使用XmlDocument.Load方法。 It can load XML from an URL. 它可以从URL加载XML。

You can call any .NET framework classes you like on Windows, including ones that do network access and XML handling. 您可以在Windows上调用任何您喜欢的.NET框架类,包括进行网络访问和XML处理的.NET框架类。 On Xbox you are limited to what XNA provides to you which is a subset of the .NET framework and the only network access is through the Xbox Live APIs. 在Xbox上,您只能使用XNA为您提供的内容,它是.NET框架的一个子集,唯一的网络访问是通过Xbox Live API。

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

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