我在从文件夹路径查看图像时遇到问题.我不知道如何解决这个问题.我试过用
String Path = @"C:\Users\PC\Documents\Visual Studio 2012\ProjectName\image-folder\mypicture.jpg";
picturebox_view.Image = Image.FromFile("'" + Path + "'");
Run Code Online (Sandbox Code Playgroud)
我收到以下错误说
The Given Path's Format Is Not Supported...
Run Code Online (Sandbox Code Playgroud)
当我试图调试并检查我的"路径"的值时,它似乎是错误的.结果就是这样
String Path = "C:\\Users\\PC\\Documents\\Visual Studio 2012\\...";
Run Code Online (Sandbox Code Playgroud)
我尝试使用替换参数的Path2,但它似乎并没有在我的工作.
String Path = @"C:\Users\PC\Documents\Visual Studio 2012\ProjectName\image-folder\mypicture.jpg";
String Path2 = Path.Replace(@"\\", @"\");
picturebox_view.Image = Image.FromFile("'" + Path2 + "'");
Run Code Online (Sandbox Code Playgroud)
在此先感谢我的同事们.