I am pretty new to WPF.
I have developed a simple application using WPF. Now, I need to communicate to a webserver (say something like http://www.xyztest.com/downloads/test.txt) and download the test.txt to my local drive (or the user specified directory.)
How do i do this? Or where do I get started for learning to communicate to a Web! I googled out but things are little complex. As a easy starting point, please do suggest a simple code sample that shall communicate (or download a text file from internet) whose location is already known.
Thanks.
WebClient.DownloadFiledoes exactly this. TheWebClientclass is not particular to WPF, it can be used from any kind of application.There are also many other ways to access networking functionality, each with its own balance between convenience and power of expression. For more powerful (but also more verbose) code you should also look at
WebRequest.Createand the associated classHttpWebRequest.