小编Ser*_*iko的帖子

当我连接到whatismyip.com时,为什么会出现"403 Forbidden"?

使用以下代码,我得到异常类EIdHTTPProtocolException,消息'HTTP/1.1 403 Forbidden'.处理svchostip.exe(11172)

function GetInternetIP:string;
var
  IdHTTPMainUrl : TIdHTTP;
begin
  try
    IdHTTPMainUrl := TIdHTTP.Create(nil);
    IdHTTPMainUrl.Request.Host := 'http://www.whatismyip.com/automation/n09230945.asp';
    Result := idHTTPMainUrl.Get('http://automation.whatismyip.com/n09230945.asp');
  except
    IdHTTPMainUrl.Free;
  end;
end;
Run Code Online (Sandbox Code Playgroud)

delphi

5
推荐指数
1
解决办法
6023
查看次数

如何使用PowerShell将部分添加到web.config?

如何system.serviceModel在web.config中添加一个部分(如果它尚不存在)?

之前:

<system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

后:

<system.serviceModel>
 <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
 <bindings>
      <basicHttpBinding>
        <binding name="ValidationServiceSoap" 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="Transport">
            <transport clientCredentialType="Ntlm" />
            <message clientCredentialType="UserName" />
          </security>
        </binding>
      </basicHttpBinding>
 <bindings>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

xml powershell sharepoint web-config

3
推荐指数
1
解决办法
2658
查看次数

标签 统计

delphi ×1

powershell ×1

sharepoint ×1

web-config ×1

xml ×1