一个solution里包含了3个project,其中一个是web的project,另一个数据库调用的project,还有一个准备生成exe的project。
在exe的project内调用前两个project里的数据和方法,例如app.config内的值都可以取到,但web.config里的内容无论如何都取不出值,有什么办法吗??例如:
<connectionStrings>
<add name="conStr" connectionString="Server=(local)\SQLEXPRESS;Initial Catalog=CSSAS;Integrated Security=SSPI;User Instance=false"/>
</connectionStrings>
在exe的project内调用前两个project里的数据和方法,例如app.config内的值都可以取到,但web.config里的内容无论如何都取不出值,有什么办法吗??例如:
<connectionStrings>
<add name="conStr" connectionString="Server=(local)\SQLEXPRESS;Initial Catalog=CSSAS;Integrated Security=SSPI;User Instance=false"/>
</connectionStrings>
Doc.Load("......\webconfig.config");
XmlNode Node=Doc.SelectSingleNode("/connectionStrings/add[@name='conStr']);
String connectionString=Node.Attributes["connectionString"].InnerText;