![](/img/trans.png)
[英]C# - How do I get the URL of an icon from Steam Trading API (encoded)
[英]How i get URL of steam apps in c#
如果您知道 steam.exe 的位置,則打開 Steam 應用程序非常簡單。
System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Steam\steam.exe","steam://rungameid/730");
在我的情況下(我認為它也是默認值),您只需提供 steam.exe 的路徑並將快捷方式的內容作為參數傳遞即可啟動應用程序。
編輯:如果你想獲得參數值,你可以使用讀取文件
File.ReadAllLines(path);
並從字符串中獲取參數,它看起來像這樣:
string[] lines = File.ReadAllLines(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/Golf With Your Friends.url");
string argument = lines.ToList().FirstOrDefault(item => { return item.Contains("steam://"); }).Replace("URL=", "");
System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Steam\steam.exe", argument);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.