The Code is as follows:
Using System;
Using System. Collections. Generic;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Text;
Using System. Windows. Forms;
Using System. IO;
Using System. Net;
Using System. Xml;
Using System. Collections;
Namespace FinallyDemo
{
Public partial class frmRSS: Form
{
Public frmRSS ()
{
InitializeComponent ();
}
String url = "";
String xmlFilePath = "";
XmlDocument doc = new XmlDocument ();
TreeNode tnroot = new TreeNode ();
Public void DownLoadXml (string url)
{
If (File. Exists (xmlFilePath ))
{
File. Delete (xmlFilePath );
}
WebClient wc = new WebClient ();
Try
{
Wc. DownloadFile (url, xmlFilePath );
}
Catch (System. Exception ex)
{
MessageBox. Show (ex. ToString ());
}
}
Public void LoadXml ()
{
If (File. Exists (xmlFilePath ))
{
Doc. Load (xmlFilePath );
XmlNode firstNode = doc. DocumentElement. FirstChild;
XmlNode root = firstNode. FirstChild;
TreeView1.Nodes. Add (root. InnerText );
Tnroot = treeView1.Nodes [0];
}
}
Class Test
{
Public string title;
Public string url;