未将对象引用到对象的实例 或者App.Config文件中没有appSettings这一节? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不会吧,我的App文件就在那个路径下啊 xml文件内容是什么,还有错误信息到底是什么什么都不说我怎么知道你怎么了 xmlDoc.SelectSingleNode("appSettings") 这个结果是null 后面不能在获取值 ,检查下了 未将对象引用到实例,就是某个变量为NULL了你到底是SelectSingleNode("appSettings")为NULL还是.ChildNodes为NULL啊 我把App文件贴出来给你看下:<?xml version="1.0"?><configuration> <appSettings> <add key="ConStringEncrypt" value="false"/> <!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />--> <add key="ConnectionString" value=""/> <add key="AppName" value="OA"/> </appSettings> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> <message clientCredentialType="UserName" algorithmSuite="Default"/> </security> </binding> </basicHttpBinding> </bindings> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup></configuration> 不会吧,我的App文件就在那个路径下啊我把App文件贴出来给你看下:<?xml version="1.0"?><configuration> <appSettings> <add key="ConStringEncrypt" value="false"/> <!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />--> <add key="ConnectionString" value=""/> <add key="AppName" value="OA"/> </appSettings> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> <message clientCredentialType="UserName" algorithmSuite="Default"/> </security> </binding> </basicHttpBinding> </bindings> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup></configuration> 我把App文件贴出来给你看下:<?xml version="1.0"?><configuration> <appSettings> <add key="ConStringEncrypt" value="false"/> <!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />--> <add key="ConnectionString" value=""/> <add key="AppName" value="OA"/> </appSettings> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> <message clientCredentialType="UserName" algorithmSuite="Default"/> </security> </binding> </basicHttpBinding> </bindings> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup></configuration> 如何从jpeg图像读取质量因数? WPF中怎么画内切椭圆? C# GDI+绘制文字换行问题 文本信息提取 密码到期提醒怎么实现 Assembly不存在? C# Label中的Visible怎么用? 大家都来谈谈自己团队中的项目的基本架构情况吧!都是怎么实现的! 简单问题送高分,有2个类实现接口,执行该接口的方法后,我如何知道该接口是调用哪个类的实现方法? 准备写开题报告了,兄弟姐妹们给点建议 WPF treeivew 数据绑定 如何在一个纯类库中使用另一个类库中的EF?
什么都不说我怎么知道你怎么了
你到底是SelectSingleNode("appSettings")为NULL
还是.ChildNodes为NULL啊
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="ConStringEncrypt" value="false"/>
<!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />-->
<add key="ConnectionString" value=""/>
<add key="AppName" value="OA"/>
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings> </system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
<configuration>
<appSettings>
<add key="ConStringEncrypt" value="false"/>
<!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />-->
<add key="ConnectionString" value=""/>
<add key="AppName" value="OA"/>
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings> </system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
<configuration>
<appSettings>
<add key="ConStringEncrypt" value="false"/>
<!--<add key="ConnectionString" value="server=192.168.0.123;database=jijiaOAICE;uid=sa;pwd=sa;pooling=false " />-->
<add key="ConnectionString" value=""/>
<add key="AppName" value="OA"/>
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="AuthorityServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings> </system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>