使用webclient问题下载文件表明您没有登录。 [英] downloading file using webclient issue shows you are not log in.

查看:67
本文介绍了使用webclient问题下载文件表明您没有登录。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows网页浏览器控件从安全网站使用网络客户端自动下载文件,但它显示消息



Servlet响应消息

您尚未登录。请先登录。



这是我的代码



I am using windows web browser control to automatic download files using web client from secured site but it show message

Servlet Response Message
You are not logged on. Please logon first.

here is my code

WebClient client = new WebClient();
client.Credentials = new NetworkCredential("username", "pwd");
client.DownloadFile(new Uri("https://infodirect.pershing.com/cehttp/servlet/MailboxServlet?operation=DOWNLOAD&mailbox_id=id3auhfu&batch_num=0069843&data_format=A&batch_id=071213.ACCT"), @"C:\Downloads\071213.ACCT");

推荐答案

我不知道这是否重要,但请尝试设置:



I don't know if it matters, but try setting:

client.UseDefaultCredentials = false;





祝你好运!



Good luck!


这篇关于使用webclient问题下载文件表明您没有登录。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆