如果我想从项目中读取本地文件,给定项目目录的相对路径,我该如何实现?
您可以获得ApplicationBasePath from PlatformServices.ApplicationEnvironment。这将使解析相对于应用程序基本路径的非绝对路径成为可能。
ApplicationBasePath
PlatformServices.ApplicationEnvironment