Get the image file path
Posted
by Googler
on Stack Overflow
See other posts from Stack Overflow
or by Googler
Published on 2010-05-20T06:01:37Z
Indexed on
2010/05/20
6:10 UTC
Read the original article
Hit count: 242
HI,
I am trying to retrive the filname of the image file from a file path in my code.
My filepath: c:\mydocuments\pictures\image.jpg
which method can i use in c# to get he filename of the above mentioned path.
Like String file = image.jpg
I have used the system.drawing to get he path, but it returns null.
my code:
string file = System.drawing.image.fromfile(filepath,true);
Is this the right way to get the image file name or is there any other inbuilt method in c#.
Pls help me on this?
© Stack Overflow or respective owner