[英]When I try to load image from mysql database i get error “Parameter is not valid” and when i try to load an image from db
[英]When I try to show an image on linklabel click, I get an error
当我尝试在linklabel单击上显示图像时,出现错误:无法识别的转义序列。
码:
public void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start(
"mspaint~C:\Users\Joshua Banks\Desktop\Downtown_atlanta_night.jpg");
}
您需要通过用另一个\\转义或使用逐字字符串来转义字符串(图像路径)中的\\字符。
转义字符:
System.Diagnostics.Process.Start("mspaint~C:\\Users\\Joshua Banks\\Desktop\\Downtown_atlanta_night.jpg");
逐字字符串文字:
System.Diagnostics.Process.Start(@"mspaint~C:\Users\Joshua Banks\Desktop\Downtown_atlanta_night.jpg");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.