{"id":1393,"date":"2008-09-03T23:52:00","date_gmt":"2008-09-03T14:52:00","guid":{"rendered":"https:\/\/hdmr.org\/d\/?e=112"},"modified":"2008-09-03T23:52:00","modified_gmt":"2008-09-03T14:52:00","slug":"blogn-112","status":"publish","type":"post","link":"https:\/\/hdmr.org\/d\/?e=112","title":{"rendered":"\u9905\u306f\u9905\u5c4b\u3068\u8a00\u3046\u304c\u3001HTTP\u306f.NET Framework?"},"content":{"rendered":"<p>CSV\u3092\u6b63\u898f\u8868\u73fe\u3067\u8aad\u307f\u8fbc\u3080\u306e\u306f\u3084\u306f\u308a\u7121\u8336\u3060\u3063\u305f\u304b\u306a\u3002<br \/>\u3046\u30fc\u3093\u2026\u51e6\u7406\u901f\u5ea6\u304c\u9045\u3044\u3002<br \/>\u3082\u3046\u3061\u3087\u3063\u3068\u3044\u308d\u3044\u308d\u8003\u3048\u3066\u307f\u3088\u3046\u3002<br \/>\u307e\u3041\u6b63\u898f\u8868\u73fe\u3067\u51e6\u7406\u3059\u308b\u306e\u306f\u7d76\u5bfe\u306a\u3093\u304b\u9593\u9055\u3048\u3066\u308b\u6c17\u304c\u3059\u308b\u3057\u3002<\/p>\n<hr \/>\n<p>\u3055\u3066\u3001\u6700\u8fd1\u3057\u305f\u3044\u3053\u3068\u306b\u5408\u308f\u305b\u3066\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8abf\u3079\u3066\u3001\u305d\u308c\u3092\u5b9f\u969b\u306b\u4f7f\u3046\u3053\u3068\u3092\u3057\u3066\u3044\u307e\u3059\u3002<br \/>.NET Framework\u306f\u975e\u5e38\u306b\u6a5f\u80fd\u304c\u8c4a\u5bcc\u3067\u3001\u7d50\u69cb\u3044\u308d\u3044\u308d\u306a\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\u57fa\u672c\u7684\u306a\u3053\u3068\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u304c\u3001<br \/>\u3057\u304b\u3057\u3001\u300c\u9905\u306f\u9905\u5c4b\u300d\u3068\u8a00\u308f\u308c\u308b\u3088\u3046\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u3046\u3053\u3068\u306f\u975e\u5e38\u306b\u3088\u3044\u3068\u3002<br \/>\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u306a\u3089\u3001System.IO.StreamReader\u30af\u30e9\u30b9\u304c\u3044\u3044\u3002<br \/>\u305d\u3046\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<hr \/>\n<p>\u4eca\u65e5\u3084\u3063\u305f\u306e\u306fHTTP\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3002<br \/>\u3059\u3054\u3044\u7c21\u5358\u3067\u3059\u3002<\/p>\n<pre>System.Net.HttpWebRequest req=(System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(\"http:\/\/libserver.ddo.jp\/\");<br \/>System.Net.WebResponse res=req.GetResponse();<br \/>string res;<br \/>using (System.IO.StreamReader ressr=new System.IO.StreamReader(res.GetResponseStream())) {<br \/>  res=ressr.ReadToEnd();<br \/>}<\/pre>\n<p>\u306a\u3093\u3068\u3053\u308c\u3060\u3051\u3067\u3059\u3002\u30ad\u30e3\u30b9\u30c8\u3057\u3066\u307e\u3059\u304c\u3001System.Net.WebRequest\u578b\u306b\u4ee3\u5165\u3059\u308c\u3070\u30ad\u30e3\u30b9\u30c8\u3044\u3089\u3093\u3002<br \/>\u3051\u3069\u3001HTTP\u306e\u306a\u3089\u3001\u30ad\u30e3\u30b9\u30c8\u3057\u3066\u3067\u3082HttpWebRequest\u578b\u3092\u4f7f\u3063\u305f\u65b9\u304c\u9ad8\u6a5f\u80fd\u3002\u5f8c\u306b\u8a00\u3046UserAgent\u3068\u304b\u3002<br \/>\u3057\u304b\u3082\u3001GetResponseStream\u3067System.IO.Stream\u306e\u3092\u5f97\u305f\u3089\u3044\u308d\u3093\u306a\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3088\u306d\u3002<br \/>\u4eca\u56de\u306fStreamReader\u3067\u8aad\u3093\u3067\u307e\u3059\u304c\u3001System.Xml.XmlDocument\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u3063\u3066\u304b\u3089\u3001Load\u30e1\u30bd\u30c3\u30c9\u3067\u8aad\u3093\u3060\u308a\u3044\u308d\u3044\u308d\u3002<br \/>StreamReader\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u3001Stream\u3060\u3051\u6e21\u3057\u3066\u307e\u3059\u304c\u3001Encoding\u3092\u6e21\u305b\u3070\u3044\u308d\u3044\u308d\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u306d\u3002<br \/>\u7701\u7565\u3057\u305f\u3089UTF-8\u3067\u3059\u3002<br \/>UserAgent\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u9069\u5f53\u306b\u8a2d\u5b9a\u3059\u308b\u3068\u5b9f\u7528\u7684\u306b\u3082\u306a\u308b\u3057\u3001\u304a\u3082\u3057\u308d\u304f\u3082\u306a\u308b\u3002<\/p>\n<hr \/>\n<p>POST\u3067\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u3068\u304b\u306a\u308b\u3068\u3061\u3087\u3063\u3068\u3081\u3093\u3069\u304f\u3055\u3044\u3051\u3069\u3001\u305d\u3093\u306a\u5834\u5408\u306fSystem.Net.WebClient\u30af\u30e9\u30b9\u304c\u4fbf\u5229\u3060\u3068\u304b\u3002<br \/>WebRequest\u30af\u30e9\u30b9\u3067\u3084\u308b\u306a\u3089\u3070\u3001<br \/>Method\u30d7\u30ed\u30d1\u30c6\u30a3\u3092&#8221;POST&#8221;\u306b\u3057\u3066\u3001<br \/>&#8220;foo=100&#038;bar=\u305f\u306c\u304d&#8221;\u306e\u3088\u3046\u306a\u6587\u5b57\u5217\u3092\u3001\u9069\u5f53\u306a\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u30d0\u30a4\u30c8\u5217\u306b\u5909\u63db\u3002<br \/>\u30d0\u30a4\u30c8\u5217\u306b\u5909\u63db\u3059\u308b\u306e\u306f\u3001Encoding\u30af\u30e9\u30b9\u306eGetBytes\u30e1\u30bd\u30c3\u30c9\u3067\u3067\u304d\u308b\u306d\u3002<br \/>\u305d\u308c\u3067\u30d0\u30a4\u30c8\u5217\u306e\u9577\u3055\u3092ContentLength\u306b\u3001&#8221;application\/x-www-form-urlencoded&#8221;\u3092ContentType\u306b\u3002<br \/>\u305d\u308c\u3067dataStream\u3092\u4f7f\u3063\u3066\u66f8\u304d\u8fbc\u3093\u3067\u3084\u308c\u3070\u3044\u3044\u3068\u3002<br \/>\u3068\u8a00\u3063\u3066\u307f\u305f\u306e\u306f\u3044\u3044\u304c\u3001\u5b9f\u969b\u8a66\u3057\u3066\u306a\u3044\u3051\u3069\u306d\u3002<\/p>\n<hr \/>\n<p>\u3055\u3066\u3001CSV\u306e\u89e3\u91c8\u3082\u3001Microsoft.VisualBasic.FileIO.TextFieldParser\u30af\u30e9\u30b9\u3067\u3084\u308d\u3046\u304b\u306d\u3047\u3002<br \/>\u521d\u3081\u304b\u3089\u305d\u3046\u3057\u3068\u3051\u3070\u3088\u304b\u3063\u305f\u3068\u3044\u3046\u306e\u306f\u3042\u308b\u3051\u3069\u306d\u3002<br \/>\u3057\u304b\u3057\u3001\u3053\u3046\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u304cVB\u7528\u3068\u3057\u3066\u7528\u610f\u3055\u308c\u3066\u308b\u306e\u306f\u3069\u3046\u3082\u6c17\u306b\u98df\u308f\u3093\u3002<br \/>\u307e\u3041\u305d\u3093\u306a\u3053\u3068\u8a00\u3063\u3066\u3082\u4ed5\u65b9\u306a\u3044\u3051\u3069\u306d\u3002<br \/>\u4fbf\u5229\u306a\u3082\u306e\u306f\u4f7f\u3044\u307e\u3057\u3087\u3046\u3068\u8a00\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSV\u3092\u6b63\u898f\u8868\u73fe\u3067\u8aad\u307f\u8fbc\u3080\u306e\u306f\u3084\u306f\u308a\u7121\u8336\u3060\u3063\u305f\u304b\u306a\u3002\u3046\u30fc\u3093\u2026\u51e6\u7406\u901f\u5ea6\u304c\u9045\u3044\u3002\u3082\u3046\u3061\u3087\u3063\u3068\u3044\u308d\u3044\u308d\u8003\u3048\u3066\u307f\u3088\u3046\u3002\u307e\u3041\u6b63\u898f\u8868\u73fe\u3067\u51e6\u7406\u3059\u308b\u306e\u306f\u7d76\u5bfe\u306a\u3093\u304b\u9593\u9055\u3048\u3066\u308b\u6c17\u304c\u3059\u308b\u3057\u3002 \u3055\u3066\u3001\u6700\u8fd1\u3057\u305f\u3044\u3053\u3068\u306b\u5408\u308f\u305b\u3066\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u8abf\u3079\u3066\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1393","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1393"}],"version-history":[{"count":0,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=\/wp\/v2\/posts\/1393\/revisions"}],"wp:attachment":[{"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdmr.org\/d\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}