c# - Download a file using URL in WPF Application without opening browser -
this question has answer here:
- how download file website in c# [closed] 7 answers
is possible download file using download link url using c# wpf application without opening browser? example: link - http://example.url.com when typed address bar of browser automatically downloads file. how can download file upon button click in wpf application (c#) without opening browser?
tia.
you can use webclient.downloadfile
, if want download specific file , store on machine:
using (webclient client = new webclient()) { client.downloadfile(remotefilename, localfilename); ... }
or webclient.downloadstring
, if want page's content string
:
using (webclient client = new webclient()) { string reply = client.downloadstring (address); ... }
Comments
Post a Comment