这也许是一个愚蠢的问题,但想知道如何检索图像的名称。
例如
string name;
Image imageOne = Image.FromFile("../../Images/PozeOne.jpg");
name = ?
您可以使用 Path.GetFilename
var path = "../../Images/PozeOne.jpg";
Image imageOne = Image.FromFile(path);
string name = Path.GetFilename(path);
"PozeOne.jpg" is the name of image.... :-)
string path="../../Images/PozeOne.jpg";
string[] imageName=path.split('/');
string image_Name_Is= imageName[imageName.Lenght-1];