William Ryan <do********@comcast.nospam.net> wrote:
Like Peter mentioned, the Path class is an easy way to do
it....
System.IO.Path p;
string s = Crypto.EncryptFile(FileName
(i));
string shortName = p.GetFileName(s);
The filename property of the fileinfo class (I think) will
give it to you as well..but I know the top one does.
Path.GetFileName is a static method, and cannot be called with a
reference. This is good, as it means you don't end up with a variable
there for no good reason, and a call which looks like it's an instance
method.
(This is one area where C# wins over Java, although with suitable
settings in some IDEs such as Eclipse, you can turn it into a
warning/error in Java, too.)
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too