在 c# 中获取 cloudflare 后面的站点的内容

Get contents of a site behind cloudflare in c#

我想获取 cloudflare 背后的站点的内容 我用

WebClient webcl = new WebClient();
string content = webcl.DownloadString("http://example.com");

但是没用 它只显示 cloudflare 的代码,不包含站点内容

CloudFlare 似乎出于某种原因阻止了您。为了解决这个问题,您需要 whitelist your C# server in CloudFlare itself 或添加一个不通过 CloudFlare 的子域。如果您的 IP 发生变化,您需要通过 CloudFlare API 加入白名单,或者仅通过具有静态 IP 的代理进行路由。