[C#] URL에서 XML 해석
XmlDocument doc = new XmlDocument(); doc.Load("URL주소"); XmlNodeList forecastNodes = doc.SelectNodes("rss/channel/item"); foreach (XmlNode node in forecastNodes) { if (node["category"] != null) { if (node["category"].InnerText == "NOTICE") { string parseFormat = "ddd, dd MMM yyyy HH:mm:ss zzz"; DateTimeOffset dto = DateTimeOffset.ParseExact(node["pubDate"].InnerText, parseFormat, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None); DateTextbox.Text = dto.ToString("yyyy년 MM월 dd일 (ddd) tt h시 mm분"); break; } } }