如何在不添加对 system.windows.forms 的引用的情况下获取 exe 的启动路径( system.windows.forms.application.StartupPath )?
你可以尝试
System.AppDomain.CurrentDomain.BaseDirectory
这适用于大多数情况。