Click to See Complete Forum and Search --> : Short file name


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)
{
// ???
}

pareshgh
February 3rd, 2003, 09:35 PM
to view the link click here

:D

GOTDOTNET C#.NET (http://gotdotnet.com/Community/MessageBoard/Thread.aspx?id=70291)

Paresh