c#做部署程序时,怎么在安装后的AfterInstall函数里边获取安装包里边的文件?

2025-02-23 21:18:02
推荐回答(1个)
回答1:

System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();string path = asm.Location.Remove(asm.Location.LastIndexOf("\\"));
这个path就是Application Folder的根目录了,如果你要找Application Folder 下的a.txt
那么path+@"\a.txt" 就是了