Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是winform应用程序的新手。这是从桌面快捷方式图标打开的一种查找应用程序的方法。
您可以在快捷方式中添加一个参数:
并通过它在您的应用程序中检查它Environment.CommandLine:
Environment.CommandLine
但除此之外,没有。您将无法判断是否有人直接单击了可执行文件,或者即使有人删除了快捷方式中的参数。