How to shorten the string of file path? [Resolved]
I add an OpenFileDialog to my project.
In order to identify the path of the file that I want to open, I added this code:
Code:
Dim strSourceFilename As String = OpenFileDialog.FileName
As a result, strSourceFilename will show the file path. For example:
Quote:
C:\Documents and Settings\Tan\My Documents\Trainee\Payroll System\frmMain.vb
How can I shorten the file path to look something like this:
Quote:
C:\Documents and Settings\.....\Payroll System\frmMain.vb
I just want the string in the middle part be replaced by ".....", while the front part and the end part (file name) remain unchanged.
How can I make it? please guide me. thank you.