插件开发中引用相对路径
我在开发插件中需要读取文件:string linqContent= File.ReadAllText("linq.min.js");已经将文件放在Resources/linq.min.js文件夹中
现在碰到的问题,如何来配置相对路径,从插件目录中读取,而不是程序主文件目录。
var dllDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location.ToString());
var jsPath = System.IO.Path.Combine(dllDir, "Resources", "linq.min.js");
var json = File.ReadAllText(System.IO.Path.GetFullPath(jsPath)); Ben.C 发表于 2024-5-13 09:26
var dllDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Loc ...
感谢大神!
测试可以了! {:5_110:}
页:
[1]