C#窗口程序 资源载入路径

it2023-05-07  74

由于可执行文件在bin/Debug下,所以bin/Debug文件夹下的文件可以直接使用(相对路径)

获取该目录下文件的绝对路径

public static string CombinePath(string path) { return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path); }

载入图片

Image img = Image.FromFile(path);
最新回复(0)