how to get vaue for string

Private Function addfolder()
Dim nodelevel As Integer = UserTree.SelectedNode.Level
Dim fol As String = folder + "\" + TxtFolderName.Text
If UserTree.SelectedNode.Text = "Downloads" Then
Directory.CreateDirectory(fol)
Else
Dim d1 As DirectoryInfo() = New DirectoryInfo(folder).GetDirectories()
If d1.Length = 0 Then
Directory.CreateDirectory(fol)
Else
Dim d2 As DirectoryInfo
Dim f As String = ""
Dim f1 As String = ""
Dim f2 As String = ""
Dim f3 As String = ""
'Dim f1, f2 As String
Dim p As String = ""

Dim i As Integer
For i = 0 To nodelevel - 1
If i > 0 Then
p = p + ".Parent"

End If
Next
For i = 0 To nodelevel - 1
f1 = f1 + ".Parent"
f = "UserTree.SelectedNode" + f1 + ".Text"
' f2 = f.Substring(1, f.Length - 1)
f2 = f.Replace(f.Length - 1, f.Length)
If f2.Length > 0 Then
'f2 = f2.Substring(0, f2.Length)
f3 = f2 + " \ " + f3
End If
Next
p = "UserTree.SelectedNode" + p + ".Text"
p = p.Replace(p.Length - 1, p.Length)
For Each d2 In d1
If d2.Name = UserTree.SelectedNode.Text Then
Directory.CreateDirectory(d2.FullName + "\" + TxtFolderName.Text)
ElseIf d2.Name = p Then
Directory.CreateDirectory(d2.FullName + "\" + f2 + "\" + TxtFolderName.Text)
End If
Next
'For Each d2 In d1
' If d2.Name = UserTree.SelectedNode.Text Then
' Directory.CreateDirectory(d2.FullName + "\" + TxtFolderName.Text)
' Exit For
' ElseIf d2.Name = UserTree.SelectedNode.Parent.Text Then
' f = UserTree.SelectedNode.Text
' Directory.CreateDirectory(d2.FullName + "\" + f + "\" + TxtFolderName.Text)
' Exit For
' ElseIf d2.Name = UserTree.SelectedNode.Parent.Parent.Text Then
' f = UserTree.SelectedNode.Text
' f1 = UserTree.SelectedNode.Parent.Text + "\" + f
' Directory.CreateDirectory(d2.FullName + "\" + f1 + "\" + TxtFolderName.Text)
' Exit For
' ElseIf d2.Name = UserTree.SelectedNode.Parent.Parent.Parent.Text Then
' f = UserTree.SelectedNode.Text
' f1 = UserTree.SelectedNode.Parent.Text + "\" + f
' f2 = UserTree.SelectedNode.Parent.Parent.Text + "\" + f1
' Directory.CreateDirectory(d2.FullName + "\" + f2 + "\" + TxtFolderName.Text)
' Exit For
' Else
' End If
'Next
End If
End If
End Function


How to get p="usertree.selectednode.parent.parent.text" i want value for usertree.selectednode.parent.parent.text in that if condition.

Thanks in Advance