代码出错

时间:2013-04-12 09:10:28

标签: c# asp.net

ProcessStartInfo startInfo = new ProcessStartInfo();

startInfo.FileName = @"c:\windows\system32\rundll32.exe";

startInfo.Arguments = 
@"C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen C:\Users\Sony\Desktop\c.jpg"

我想将图像URI (C:\Users\Sony\Desktop\c.jpg)指定为字符串变量。所以我必须在startInfo.Arguments中进行哪些更改。

1 个答案:

答案 0 :(得分:1)

然后手工构建它。

string imagePath = "C:\Users\Sony\Desktop\c.jpg"; // or get this value from however you please
string arguments = string.Format("C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen {0}", imagePath);
startInfo.Arguments = arguments;