我似乎有一個奇怪的問題與System.Diagnostics.Process.Start方法。我有一個使用3.5 SP1 .NET Framework的C#桌面應用程序。用戶點擊一個標籤,該標籤將存儲在其標籤中的文件夾路徑作爲字符串傳遞給函數。 Windows資源管理器啓動正確的文件夾。當此工具安裝在Citrix上並通過已發佈的應用程序運行時,Windows資源管理器仍將啓動,但也會顯示一個.NET異常消息「系統找不到指定的文件」。存在System.Diagnostics.Process.Start問題
System.ComponentModel.Win32Exception: The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
文件路徑,因爲它是剛剛推出就OK和代碼工作沒有錯誤時到服務器上本地登錄,它只是錯誤,因爲發佈的應用程序,我的代碼如下
Label label = (Label)sender;
if (label.ForeColor == Color.Blue) {
if (System.IO.Directory.Exists(label.Tag.ToString()) == false)
{
MessageBox.Show("The specified folder does not exist:" +
Environment.NewLine + Environment.NewLine + label.Tag.ToString(), "",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
System.Diagnostics.Process.Start(label.Tag.ToString());
}
我發現這個頁面http://forums.citrix.com/thread.jspa?messageID=1382638,但我們沒有在服務器上的IIS。
任何人都可以幫忙嗎?
感謝, 羅布
你的意思是讓用戶進入到一個網頁,點擊安裝,你已經做了Web部署? – GenericTypeTea 2009-09-10 10:09:05
否這是由Citrix作爲已發佈應用程序發佈的桌面應用程序。桌面應用程序中有鏈接,它在各個文件夾位置啓動Windows資源管理器 – rob 2009-09-10 10:11:31
這些文件夾位於網絡驅動器上。完整的地址(例如域名等)用於傳遞到啓動功能。 Citrix服務器可以訪問文件夾區域。 只是爲了確認Windows資源管理器確實從此功能啓動到正確的文件夾。一旦Windows資源管理器啓動,就會出現異常消息。 – rob 2009-09-10 11:12:38