這就是我目前爲止的內容。我試圖從URL中讀取XML,例如溫度,溼度等....但是每次我嘗試別的時候都會給我一個錯誤。我想檢索信息並將其放入標籤中。從URL中讀取xml
namespace WindowsFormsApplication1 {
public partial class Form1: Form {
public Form1() {
InitializeComponent();
}
private void btnSubmit_Click(object sender, EventArgs e) {
String zip = txtZip.Text;
XmlDocument weatherURL = new XmlDocument();
weatherURL.Load("http://api.wunderground.com/api/"
your_key "/conditions/q/" + zip + ".xml");
foreach(XmlNode nodeselect in weatherURL.SelectNodes("response/current_observation"));
}
}
}
顯示XML的樣子以及您試圖從中解析出哪些準確的信息。 – 2013-02-15 22:09:27
「它給我一個錯誤」是永遠不夠的信息 - 請參閱http://tinyurl.com/so-list – 2013-02-15 22:14:19