图像未从本地驱动器加载到应用程序中(Images not loading in application from a local drive)
我有一个C#应用程序来显示图像。 我有以下代码,我想从本地驱动器显示如下:
img.src = "D:\abc.png";但上面的代码没有呈现任何图像。 什么是正确的格式?
I have an C# application to display an image. I have the following code where I want to display from the local drive as follows:
img.src = "D:\abc.png";But the above code is not rendering any image. What could be the correct format?
最满意答案
正如我评论你可以试试@
img.src = @"D:\abc.png";因为\将被视为转义序列的开始。 避免它@会有所帮助
As I commented you can try with @
img.src = @"D:\abc.png";because \ will consider as starting of a escape sequence. to avoid it @ will help
更多推荐
发布评论