Path.GetDirectoryNamemethod can be used to return "c: \ projects \ roott \ wsdlproj \ devlop \ beta2" , as shown below:
Dim filePath As String = "c:\projects\roott\wsdlproj\devlop\beta2\text"
Dim directory As String = Path.GetDirectoryName(filePath)
To get only the name of the parent folder "beta2" , you can split the entry and take the second last entry, given that the input is really accurate:
Dim split As String() = filePath.Split("\")
Dim parentFolder As String = split(split.Length - 2)