Wednesday, November 7, 2012

How to get download file length by WebClient?

            byte[] buffer;
            var client = new WebClient();
            buffer = client.DownloadData("http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js");
            Stream strm = new MemoryStream(buffer);
            var fileLength = strm.Length;

No comments:

Post a Comment