How to check if System.Net.WebClient.DownloadData is downloading a binary file?

前端 未结 7 722
太阳男子
太阳男子 2020-11-29 00:24

I am trying to use WebClient to download a file from web using a WinForms application. However, I really only want to download HTML file. Any other type I will

7条回答
  •  不知归路
    2020-11-29 01:12

    You could issue the first request with the HEAD verb, and check the content-type response header? [edit] It looks like you'll have to use HttpWebRequest for this, though.

提交回复
热议问题