您可以使用 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;