嗨! 我正在用C#编写插件,用于使用SDK的CAD程序。 该插件将是一个DLL当然。 我想创建一个包含插件设置的ini文件。 所以我需要的目录插件? 如何获取包含dll文件的目录? 提前感谢您的帮助。 A. 我尝试过: 我试图在网上寻找解决方案。但我还没有找到。
Hi! I'm writing a plugin in C# for a CAD program used its SDK. The plugin will be a DLL of course. I would like to create an ini file that contain the settings of the plugin. So I need the directory of the plugin? How can I get that directory that contain the dll file? Thank you in advance for your help. A. What I have tried: I have tried to look for a solution on the web. But I haven't found yet.
推荐答案你可以使用: Assembly.GetExecutingAssembly().CodeBase
但它需要一些清理,因为它以file:///开头。 有关详细信息,请参阅此处: Assembly.CodeBase Property(System.Reflection) [ ^ ]
But it will need some cleaning up, as it starts with "file:///". See here for more information: Assembly.CodeBase Property (System.Reflection)[^]
更多推荐
插件的配置文件
发布评论