There are a couple of ways to do it, one is to string.split to split the string at the "/" charater and take the 2nd element of the returned array. The other option is to use string.substring... I think the 2nd option is cleaner in this case
For the 2nd question, you can use System.IO.Path.GetFileName("put the path here") to get the name of the folder. You then assign it to your label.text property. You can save the full path in your label.Tag propertyCode:Dim userName As String = yourstring.Substring(yourstring.IndexOf("/") + 1)




Reply With Quote