Click here to Skip to main content
15,888,037 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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

C#
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");
Posted
Updated 16-Jul-13 1:58am
v2
Comments
[no name] 16-Jul-13 7:29am    
http://www.codeproject.com/Answers/621138/Download-file-using-Webclient-shows-Wrong-Data#answer1

1 solution

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

C#
client.UseDefaultCredentials = false;


Good luck!
 
Share this answer
 
Comments
ALTT 18-Jul-13 3:14am    
not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900