Alex F
February 3rd, 2003, 08:11 AM
I need a simple way to get short file name for display.
For example, I have full file name
C:\Dir1\Samples\Files\Doc\Figures.doc and maximum length 30, and result should be like this:
C:\Dir1\...\Doc\Figures.doc.
string s = ShortFileName("C:\\Dir1\\Samples\\Files\\Doc\\Figures.doc");
// s = "C:\Dir1\...\Doc\Figures.doc"
string ShortFileName(string fullName, int maxLen)
{
// ???
}
For example, I have full file name
C:\Dir1\Samples\Files\Doc\Figures.doc and maximum length 30, and result should be like this:
C:\Dir1\...\Doc\Figures.doc.
string s = ShortFileName("C:\\Dir1\\Samples\\Files\\Doc\\Figures.doc");
// s = "C:\Dir1\...\Doc\Figures.doc"
string ShortFileName(string fullName, int maxLen)
{
// ???
}