Hi, I am writing a VB .NET console app where it spits takes relative path and spits out all file name, or error for invalid input. I am havinf trouble getting PhysicalPath from RelativePath
Example: ` 1. I am in folder: C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj\bin\Debug
My App SP.exe is also in the same folder
I run: "SP.exe ..\" OutPut will be a list of all files in the folder of "C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj\bin"
I run: "SP.exe ..\..\" OutPut will be a list of all files in the folder of "C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol\SP_Proj"
I run: "SP.exe ..\..\..\" OutPut will be a list of all files in the folder of "C:\Documents and Settings\MehdiAnis.ULTIMATEBANGLA\My Documents\Visual Studio 2005\Projects\SP_Sol" `
Currently I am Handling 1 relative path, but not more than one:
If Source.IndexOf("..\") = 0 Then
Dim Sibling As String = Directory.GetParent(Directory.GetCurrentDirectory()).ToString()())
Source = Source.Replace("..\", Sibling)
End If
How can I easily handle multiple ..\ easily ? Thanks.