static void loadChanelXML() { var query = from p in XDocument.Load(@"c:\station.xml").Root.Elements("station") select p; myTV.ChinaTVprogramWebService area = new myTV.ChinaTVprogramWebService(); foreach (var q in query) { //wr.WriteLine(str); string[] stations = area.getTVchannelString(int.Parse(q.Element("id").Value)); XDocument xml = XDocument.Load(@"c:\channel.xml"); foreach (string str in stations) { XElement station = new XElement("channel", new XElement("station", q.Element("id").Value), new XElement("id", str.Split('@')[0]), new XElement("name", str.Split('@')[1])); xml.Root.Add(station); } makelog(q.Element("id").Value); xml.Save(@"c:\channel.xml"); } }
static void loadAreaXML() { myTV.ChinaTVprogramWebService area = new myTV.ChinaTVprogramWebService(); area.getAreaStringAsync(); area.getAreaStringCompleted += new myTV.getAreaStringCompletedEventHandler(client_getAreaStringCompleted); }