如何从Native C ++中读取App.Config

编程入门 行业动态 更新时间:2024-10-27 12:35:52
本文介绍了如何从Native C ++中读取App.Config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我有一个应用程序。它使用原生c ++包装C#dll,dll正在从app.config读取appsetting。如果我运行本机C ++程序,当我在c#dll中执行类似的操作时返回null: myapp.Browser = System.Configuration.ConfigurationManager.AppSettings [浏览器]; myapp.Browser为空。 我的问题是我必须在visual studio中为app.config文件设置任何东西,以便设置myapp.Browser? 谢谢

Hi guys, I have a app. it is using native c++ wrapping a C# dll and the dll is reading appsetting from app.config. if i run the native C++ program it return null when i do something like this in the c# dll: myapp.Browser = System.Configuration.ConfigurationManager.AppSettings["Browser"]; the myapp.Browser is null. my question is do i have to set anything in visual studio for the app.config file in order to have myapp.Browser set? thanks

推荐答案

使用AppDomain.CurrentDomain.SetupInformation.ConfigurationFile查找应用程序配置文件。 它返回文件路径,但找不到文件 used AppDomain.CurrentDomain.SetupInformation.ConfigurationFile to find the app config file. it returned the file path, but can't find the file

更多推荐

如何从Native C ++中读取App.Config

本文发布于:2023-11-04 17:29:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1558562.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Native   App   Config

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!