I have xml file that after my application installation will located in the installation dir. i need the application to reed this file. how do i get the installation dir where the user install it in order to read this file. or is a better way to do it.

有帮助吗?

解决方案

Assuming the assembly in which this code lies is installed to the same directory:

Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top