更新时间:2022-12-30 20:54:22
到目前为止,我发现了另一种解决方案,用于从Xamarin PCL项目的App.config文件中获取密钥"StorageConnectionString".
So far, I found another solution to get key "StorageConnectionString" from App.config file for Xamarin PCL project.
您需要安装此软件包,该软件包支持获取App.config文件中密钥的值: PCLAppConfig
You need to install this package which support to get the value of key in App.config file: PCLAppConfig
然后您可以通过行代码获取值:
Then you can get the value by line code:
string storageConnectionString = PCLAppConfig.ConfigurationManager.AppSettings ["StorageConnectionString"];
string storageConnectionString = PCLAppConfig.ConfigurationManager.AppSettings["StorageConnectionString"];