[英]small window “Launching application” when I open .application winform
[英]Launching an application with an URI from winform
我有一個啟動默認程序的URI,我試圖弄清楚如何從Windows窗體應用程序啟動它。 Google上的所有結果都使用Windows Apps API來啟動URI,但我需要從表單中執行此操作。 如何才能做到這一點?
這是應用程序版本:
System.Uri uri = new System.Uri("myprotocl://10.0.0.123");
var success = await Windows.System.Launcher.LaunchUriAsync(uri);
假設您的計算機上已為“myprotocl”注冊了“處理程序”,則可以通過將uri指定為進程的文件名來啟動uri。
var url = "myprotocl://10.0.0.123";
var psi = new ProcessStartInfo();
psi.UseShellExecute = true;
psi.FileName = url;
Process.Start(psi);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.