我有一个WCF服务主机.我对wc的要求很高.我的主人,经过一段时间后表现出内存充满的问题.重复这个问题.当我打开Web服务帮助页面时,会显示以下错误:
内存门检查失败,因为可用内存(1398493184字节)小于总内存的5%.因此,该服务将无法用于传入请求.要解决此问题,请减少计算机上的负载或调整serviceHostingEnvironment配置元素上的minFreeMemoryPercentageToActivateService的值.
我在WCF主机上的web.config如下:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnable="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceHostingEnvironment minFreeMemoryPercentageToActivateService="1"/>
</behavior>
</serviceBehaviors>
Run Code Online (Sandbox Code Playgroud)
和主机web.config是
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IPaperService" clouseTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisojnMode="StringWildcard" maxBufferSize="1000000000" maxBufferPoolSize="1000000000" maxReceivedMessageSize="100000000" messageEncoding="text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="1000000000" maxArrayLength="1000000000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorthmSuite="Default" />
<security>
</binding>
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决我的问题?
我想下载pdf,WebClient但我需要发送cookie请求
如何添加cookie WebClient然后下载pdf
WebClient webClient = new WebClient();
webClient.DownloadFile("http://........", "C://2.pdf");
Run Code Online (Sandbox Code Playgroud) 我想在asp.net中获取我的网站访问者的mac地址我该怎么办?
此代码获取主机mac地址
ManagementClass objMC = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection objMOC = objMC.GetInstances();
foreach (ManagementObject objMO in objMOC)
{
if (!(bool)objMO["ipEnabled"])
continue;
string a = ((string)objMO["MACAddress"]);
}
Run Code Online (Sandbox Code Playgroud)