After select TreeView

if(e.Node.Name.EndsWith(“pdf”))

Process.Start(e.Node.Name);

else if(e.Node.Name.EndsWith(“txt”)){

this.richTextBox1.Clear();

StreamReader reader = new StreamReader(e.Node.Name);

this.richTextBox1.Text = reader.ReadToEnd();

reader.Close();

}

OR

if(e.Node.Text.Contains(“.”))

Process.Start(e.Node.Name);

 

*e.Node.Text = filename + extension

e.Node.Name = full path