I am trying to get pdf file data using webclient but it is throwing an exception of "The remote server returned an error: (404) Not Found."
Here are error details:
System.Net.WebException was caught
Message=The remote server returned an error: (404) Not Found. Source=System
StackTrace: at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadData(Uri address) at System.Net.WebClient.DownloadData(String address)
Error Status: System.Net.WebExceptionStatus.ProtocolError
Here is the code snippet am using to download data:
try{
WebClient cl = new WebClient();
byte[] data = cl.DownloadData(URL);
}
catch(exception ex){
}
Any idea??