-3

我正在使用 Aforge.net 示例,我想获取放置在资源上的图像的名称。我无法这样做,因为 image.tag 出现错误。

请帮忙

4

1 回答 1

0

您可以使用 Uri 类加载路径并从 Segments 集合中提取图像名称:

Uri uri = new Uri("http://www.XXXX.com/imageName.jpg");
string fileName = uri.Segments.Last();

编辑

让我们看看这个答案:如果你喜欢它?

C#如何从图片框中获取位图

获取位图文件名

新编辑

System.IO.FileInfo info = new System.IO.FileInfo(Properties.Resources.Stop);
string fileName = info.Name;
于 2013-03-28T11:35:21.410 回答