) respStream. Close ();
If (resp! = Null) resp. Close ();
Request = null;
Return bytData;
}
After the data is obtained, parse the necessary XML to extract the weather data.
Private void parseRssPage (byte [] rssPage)
{
MemoryStream mStream = new MemoryStream (rssPage );
XmlReader xReader = XmlReader. Create (mStream );
ForcastArray = new ArrayList ();
While (xReader. Read ())
{
If (xReader. NodeType = XmlNodeType. Element)
{
Switch (xReader. Name)
{
Case "title ":
XReader. Read ();
Break;
Case "
;
}
}
// Obtain the woeid
$ Woeid = self: getWOEID ();
Self: $ url = self: $ url. $ woeid [0];
// Obtain the weather of the current day
$ XML = self: vget (self: $ url );
// Save the day's weather to the file
Self: cacheXML ($ XML );
Self: analysisXML ($ XML );
}
Static public function analysisXML ($ simple ){
$ P = xml_parser_create ();
Xml_parse_into_struct ($ p, $ simple, $ vals, $ index );
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.