download - Getting a header/filesize in .NET -
I have two files that can be the same file, but they can not be the same URL. I want to know Are they the same by checking material-length before downloading a full? What is the best way to do this?
At the moment I am using WebBrower controls to load pages and remove data, and then using WebClient.download
to get the file. Is there any way i can use webmail to check the filesystem before downloading the whole file?
I found the excellent article, , which provides a method that Works very well for me:
Fixed public long using GetFileSize (string URL) {(WebClient obj = new WebClient)) (stream s = obj.OpenRead (url) )) Return to the long run. Text (obj.ResponseHeaders ["Content-Length"]. ToString ()); }
Comments
Post a Comment