标签: webclient

您的客户端不支持使用Windows资源管理器打开此列表

我在Windows Server 2008 R2上安装了Microsoft SharePoint和Project PWA.

当我想在Windows资源管理器中打开库时,我会随机收到错误: 您的客户端不支持使用Windows资源管理器打开此列表

当我打开IE时,它正在第1次和第2次工作,但是经过一些点击之后它不再工作了,我需要重新启动IE,然后它通常会工作几次.当它没有通过Sharepoint工作时,它也无法通过\ server\DavWWWRoot\PWA和oposite工作.

我在网上搜索了几个星期,但没有找到任何解决方案.你知道这里应该有什么问题吗?欢迎任何建议:)

webclient webdav project sharepoint-2010

9
推荐指数
2
解决办法
6万
查看次数

卷曲选项相当于Net.Webclient的"useDefaultCredentials"

我尝试在php脚本中使用curl访问web:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://www.google.fr");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}

curl_close ($ch);
Run Code Online (Sandbox Code Playgroud)

它返回:

无法连接到www.google.fr端口443:连接被拒绝

这是正常的,我是一个代理,它需要我的Windows凭据(NTLM)允许互联网流量.

在MS Powershell中,这有效:

$request = New-Object System.Net.WebCLient
$request.UseDefaultCredentials = $true
$request.Proxy.Credentials = $request.Credentials
$request.DownloadFile($url, $path)
Run Code Online (Sandbox Code Playgroud)

使用"DefaultCredentials"(= Windows Credentials)并将它们发送到代理允许我访问Web.但我现在不知道它是如何工作的.

如果我使用Firefox导航,Firefox总是会添加一个Proxy-Authorization标头,其值为:Negociate blablablablababalazdlad ...

我想将.NET useDefaultCredentials解决方案转换为cURL,我试过:

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://www.google.fr");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM );
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM );

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}

curl_close …
Run Code Online (Sandbox Code Playgroud)

curl webclient php-curl

9
推荐指数
1
解决办法
809
查看次数

在ASP.NET MVC中异步使用WebClient?

我有一个ASP.NET MVC应用程序,它当前使用WebClient类从控制器操作中对外部Web服务进行简单调用.

目前我正在使用同步运行的DownloadString方法.我遇到了外部Web服务没有响应的问题,这导致我的整个ASP.NET应用程序都缺乏线程并且没有响应.

解决此问题的最佳方法是什么?有一个DownloadStringAsync方法,但我不确定如何从控制器调用它.我需要使用AsyncController类吗?如果是这样,AsyncController和DownloadStringAsync方法如何交互?

谢谢您的帮助.

asp.net-mvc multithreading asynchronous webclient

8
推荐指数
1
解决办法
8212
查看次数

C#检测页面重定向

我试图确定http://www.accreditedqualifications.org.uk上是否存在 以下形式的资格:

http://www.accreditedqualifications.org.uk/qualification/50084811.seo.aspx

50084811是最终用户输入的资格目标.

如果他们输入无效的例如

http://www.accreditedqualifications.org.uk/qualification/50084911.seo.aspx

它们被重定向到错误页面(据我所见,http头不正确).有没有办法检测C#中的重定向.我希望能够检测到http标头中的重定向(认为它将发出2)或类似的反对必须下载整个页面.这可能会发生很多,所以我想尽量减少流量.

编辑

使用它来查看标题看起来像是为无效页面发出两个:

http://pageheaders.com/display-http-headers.php?url=http%3A%2F%2Fwww.accreditedqualifications.org.uk%2Fqualification%2F50084911.seo.aspx&agent=ie6

.net c# webclient

8
推荐指数
2
解决办法
2万
查看次数

F#中的异步异常处理

我试图在F#中编写非阻塞代码.我需要下载一个网页,但有时该网页不存在,AsyncDownloadString会抛出异常(404 Not Found).我尝试了下面的代码,但它没有编译.

我怎么能处理AsyncDownloadString的异常?

let downloadPage(url: System.Uri) = async {
    try
       use webClient = new System.Net.WebClient()
       return! webClient.AsyncDownloadString(url)
    with error -> "Error"
}
Run Code Online (Sandbox Code Playgroud)

我怎么想在这里处理异常?如果抛出错误,我只想返回一个空字符串或带有消息的字符串.

f# webclient exception-handling f#-async

8
推荐指数
1
解决办法
2932
查看次数

.NET WebClient首先发送没有身份验证的请求

我正在使用Asp.net web api构建Web服务,我必须从AXIS IP Camera获取图像.但是,摄像机使用摘要式身份验证.所以我的C#代码看起来像这样:

            WebClient webClient = new WebClient();
            webClient.UseDefaultCredentials = true;
            webClient.Credentials = new NetworkCredential("***", "***");
            byte[] imageStream = webClient.DownloadData("http://192.168.0.90/axis-cgi/jpg/image.cgi");
Run Code Online (Sandbox Code Playgroud)

这一切都有效,但在查看Fiddler时,我发现客户端在没有身份验证的情况下发送了一个请求,并返回401错误.之后,它发送具有摘要安全性的那个.

我在这里找到了一个带有手动凭证注入的解决方案:

http://kristofmattei.be/2013/02/20/webclient-not-sending-credentials-heres-why/

但这看起来不错.它使用基本身份验证,我真的不想要,看起来有点不专业.

有没有办法立即发送签名的请求或这是如何工作的,因为我注意到相机在第一个请求中返回nonce?

.net c# security webclient digest-authentication

8
推荐指数
1
解决办法
6741
查看次数

使用WebClient时的System.Net.WebException:无法创建SSL/TLS安全通道

当我执行以下代码时

System.Net.ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => {
    return true;
};
var webClient = new WebClient();
var s = webClient.DownloadString("https://jtlplugins.x-volution.de/api.php?apikey=yS5VS7OiG1ukiIqLzCSYuFCjeF1qSskKOQeCtVxh&do=pruefe_app&cappid=123&chardwareid=DC0D-BFEA-6F79-58DE-21E9-BA3A-B288-C46F&clizenzschluessel=123");
Run Code Online (Sandbox Code Playgroud)

我总是得到一个System.Net.WebException:无法创建SSL/TLS安全通道

当我执行这个

https://jtlplugins.x-volution.de/api.php?apikey=yS5VS7OiG1ukiIqLzCSYuFCjeF1qSskKOQeCtVxh&do=pruefe_app&cappid=123&chardwareid=DC0D-BFEA-6F79-58DE-21E9-BA3A-B288-C46F&clizenzschluessel=123
Run Code Online (Sandbox Code Playgroud)

例如,直接在Firefox或Internet Explorer中,它可以工作并返回结果.

我应该怎么做,这也是我的代码在浏览器中执行的?

我已经阅读了stackoverflow中有关此问题的其他帖子 - 但他们没有解决我的问题:-(

c# ssl webclient

8
推荐指数
2
解决办法
1万
查看次数

无法解析的StackExchange API响应

我编写了一个小程序来分析StackExchange API中的配置文件数据,但是api会向我发送unsarse-/unreadable数据.

收到的数据:(使用c#自行下载)

\ u001f\B\0\0\0\0\0\U0004\0mRMo0\F /:d $ C'^ {/\u0006\u0018G> \我\ u0015\U0004݀d> GRL'o\u0004G%JP\u001c-EM> 0Xbm〜\u0018tk\u0014M] rdLGv0〜FJ = 1\u00031I> kTRA \"(/ +; NL\u0018 2 H\u0014P藄XaLw#3\U0002 +\u007f\u0010\u000fp】v\u007f \吨ڧ\nf "\ u0018 \00ƺ 1x#j ^- c AX\t \u001aT @ qj \u001aU7 \u0014 \"\ a ^ \b #\ u001eQG%Y \吨חq00K\AV\u0011 {ظ\ u0005 \"\ u001d + |\u007f'\ u0016〜 8\u007f\U0001-H] O\u007fVo\u007f\U0001〜Y\U0003\U0002\0\0

想要的数据:(从我的浏览器复制粘贴)

{ "物品":[{ "badge_counts",{ "青铜":987, "银":654, "金":321}, "ACCOUNT_ID" 123456789 "is_employee":假"LAST_MODIFIED_DATE":1250612752" last_access_date ":1250540770,"年龄":0," reputation_change_year ":987," reputation_change_quarter ":654," reputation_change_month ":321," reputation_change_week ":98," reputation_change_day ":76,"信誉":9876," CREATION_DATE" :1109670518,"user_type":"registered","user_id":123456789,"accept_rate":0,"location":"Australia","website_url":" http://example.org ","link":" …

c# webclient downloadstring stackexchange-api

8
推荐指数
1
解决办法
1752
查看次数

C#WebClient - 下载文件后LOH大幅增加

我有一个班负责在下载管理器中下载文件.该类负责下载文件并将其写入给定路径.

要下载的文件大小通常在1到5 MB之间变化,但也可能更大.我正在使用WebClient类的实例从Internet获取文件.

public class DownloadItem
{
    #region Events
    public delegate void DownloadItemDownloadCompletedEventHandler(object sender, DownloadCompletedEventArgs args);

    public event DownloadItemDownloadCompletedEventHandler DownloadItemDownloadCompleted;

    protected virtual void OnDownloadItemDownloadCompleted(DownloadCompletedEventArgs e)
    {
        DownloadItemDownloadCompleted?.Invoke(this, e);
    }

    public delegate void DownloadItemDownloadProgressChangedEventHandler(object sender, DownloadProgressChangedEventArgs args);

    public event DownloadItemDownloadProgressChangedEventHandler DownloadItemDownloadProgressChanged;

    protected virtual void OnDownloadItemDownloadProgressChanged(DownloadProgressChangedEventArgs e)
    {
        DownloadItemDownloadProgressChanged?.Invoke(this, e);
    }
    #endregion

    #region Fields
    private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
    private WebClient _client;
    #endregion

    #region Properties
    public PlaylistItem Item { get; }
    public string SavePath { get; }
    public bool Overwrite …
Run Code Online (Sandbox Code Playgroud)

c# memory garbage-collection memory-leaks webclient

8
推荐指数
1
解决办法
735
查看次数

Spring WebClient reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException

我正在使用 Spring WebClient 调用休息服务。如下所述的 post 调用代码。

Mono<ClientResponse> response = client.post()
                        .uri(uriBuilder -> uriBuilder.build())
                        .headers(httpHeaders -> httpHeaders.setAll(getHeaders()))
                        .body(BodyInserters.fromPublisher(Mono.just(message), String.class))
                        .exchange();
                response.subscribe(clientResponse -> {
                   System.out.println(clientResponse.statusCode());
                });
Run Code Online (Sandbox Code Playgroud)

在连续发布一段时间后(在 5 分钟内发布 2-3 百万个请求后),我收到以下异常。

 [     parallel-3] r.c.s.Schedulers                         : Scheduler worker in group main failed with an uncaught exception

reactor.core.Exceptions$ErrorCallbackNotImplemented: reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException: Pool#acquire(Duration) has been pending for more than the configured timeout of 45000ms
Caused by: reactor.netty.internal.shaded.reactor.pool.PoolAcquireTimeoutException: Pool#acquire(Duration) has been pending for more than the configured timeout of 45000ms
    at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.run(AbstractPool.java:317) ~[reactor-netty-0.9.0.RELEASE.jar!/:0.9.0.RELEASE]
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been …
Run Code Online (Sandbox Code Playgroud)

webclient reactive spring5

8
推荐指数
1
解决办法
4389
查看次数