'How do I download a file in C# using webclient?

I have a Java application that downloads a file from a remote server. I would like to know where the application actually downloads a file. I captured a TCP/IP packet and found the below information.

protocol: TCP
remote address: xxx.xxx.xxx.xx
local port: xxxx
remote port: xxxxx

I know exact file URL now. However, when I try to access the file using web browser I see:

Internet Explorer cannot display the webpage

Since the application is compiled by java, there must be a way to do it in C#.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source