Click here to Skip to main content
15,908,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
R/Sir,

I am developing vb.net windows application
in which i want to download file from web server

i have written following code

imageAddress = "http://www.nseindia.com/archives/equities/mto/MTO_12032012.DAT"

Dim webClient As New System.Net.WebClient
webClient.Headers.Add(Net.HttpRequestHeader.UserAgent, ".Net client")
webClient.DownloadFile(imageAddress, "C:\" + filename)



but i get following error.

The remote server returned an error: (403) Forbidden.


please help me..
Thank you,
Posted
Updated 27-Mar-12 1:11am
v2

1 solution

 
Share this answer
 
Comments
Sunil Bansode 27-Mar-12 7:31am    
Thank you for reply..
i have tried this also..
but i m getting same error..
Is there any solution for it?

Thank you..

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