[Mono-list] System.Net.WebClient
ginga@kit.hi-ho.ne.jp
ginga@kit.hi-ho.ne.jp
Sun, 26 Jan 2003 15:56:05 +0900
--------_3E3384945E2F02690700_MULTIPART_MIXED_
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Hello,
I have plan to implement XmlUrlResolver. It would be convenient
for this class if OpenRead(), DownloadData(), DownloadFile() of
System.Net.WebClient are implemented.
Then I wrote very easy implementation for those methods.
I'll be grateful if anyone working with System.Net reviews the
attachment and commit somewhat I want.
Thanks,
-- Atsushi Eno
--------_3E3384945E2F02690700_MULTIPART_MIXED_
Content-Type: application/octet-stream; name="WebClient.diff"
Content-Disposition: attachment;
filename="WebClient.diff"
Content-Transfer-Encoding: base64
PyBXZWJDbGllbnQuZGlmZgpJbmRleDogV2ViQ2xpZW50LmNzCj09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6
IC9jdnMvcHVibGljL21jcy9jbGFzcy9TeXN0ZW0vU3lzdGVtLk5ldC9XZWJDbGllbnQuY3Msdgpy
ZXRyaWV2aW5nIHJldmlzaW9uIDEuMQpkaWZmIC11IC1yMS4xIFdlYkNsaWVudC5jcwotLS0gV2Vi
Q2xpZW50LmNzCTIxIE1heSAyMDAyIDAzOjA3OjIxIC0wMDAwCTEuMQorKysgV2ViQ2xpZW50LmNz
CTkgSmFuIDIwMDMgMTg6MjU6NDYgLTAwMDAKQEAgLTU4LDIyICs1OCw0NCBAQAogDQogCQkvLyBN
ZXRob2RzDQogCQkNCi0JCVtNb25vVE9ET10NCisJCVtNb25vVE9ETygiZGVwZW5kcyBvbiBPcGVu
UmVhZCIpXQ0KIAkJcHVibGljIGJ5dGUgW10gRG93bmxvYWREYXRhIChzdHJpbmcgYWRkcmVzcykN
CiAJCXsNCi0JCQl0aHJvdyBuZXcgTm90SW1wbGVtZW50ZWRFeGNlcHRpb24gKCk7DQorCQkJY29u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