{"id":288,"date":"2016-12-10T20:03:29","date_gmt":"2016-12-10T11:03:29","guid":{"rendered":"http:\/\/marius.main.jp\/software\/blog\/?p=288"},"modified":"2016-12-10T20:04:23","modified_gmt":"2016-12-10T11:04:23","slug":"system-windows-forms-webbrowser%e3%81%ae%e3%83%96%e3%83%a9%e3%82%a6%e3%82%b6%e3%83%ac%e3%83%b3%e3%83%80%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%e3%81%ae%e5%a4%89","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=288","title":{"rendered":"System.Windows.Forms.WebBrowser\u306e\u30d6\u30e9\u30a6\u30b6\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u5909\u66f4"},"content":{"rendered":"<p>System.Windows.Forms.WebBrowser\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u72b6\u614b\u3067\u306fIE7\u76f8\u5f53\u3002<\/p>\n<p>\u78ba\u8a8d\u30b5\u30a4\u30c8\uff1a<a href=\"http:\/\/www.useragentstring.com\/\" target=\"_blank\">User Agent String.Com<\/a><\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows.Forms;\r\n\r\nnamespace WindowsFormsApplication1\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\n        private void Form1_Shown(object sender, EventArgs e)\r\n        {\r\n            webBrowser1.Navigate(\"http:\/\/www.useragentstring.com\/\");\r\n        }\r\n    }\r\n}<\/pre>\n<p><a href=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2016\/12\/0001.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-289\" src=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2016\/12\/0001-300x226.png\" alt=\"\" width=\"300\" height=\"226\" srcset=\"https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0001-300x226.png 300w, https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0001-768x579.png 768w, https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0001.png 786w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>IE11\u306b\u5909\u66f4\u3059\u308b\u5834\u5408\u306f\u3001\u30ec\u30b8\u30b9\u30c8\u30ea\u300cHKEY_CURRENT_USERSOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION\u300d\u306b<\/p>\n<p>\u30d7\u30ed\u30bb\u30b9\u540d\u3068\u5bfe\u5fdc\u3059\u308b\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3059\u308b\u3002<\/p>\n<pre class=\"lang:c# decode:true \">using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows.Forms;\r\n\r\nnamespace WindowsFormsApplication1\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        private const string strRegPath = @\"SoftwareMicrosoftInternet ExplorerMainFeatureControlFEATURE_BROWSER_EMULATION\";\r\n        private Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(strRegPath, true);\r\n        private string strProcessName = System.Diagnostics.Process.GetCurrentProcess().ProcessName + \".exe\";\r\n\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\n        private void Form1_Shown(object sender, EventArgs e)\r\n        {\r\n            regKey.SetValue(strProcessName, 11001, Microsoft.Win32.RegistryValueKind.DWord);\r\n\r\n            webBrowser1.Navigate(\"http:\/\/www.useragentstring.com\/\");\r\n        }\r\n\r\n        private void Form1_FormClosing(object sender, FormClosingEventArgs e)\r\n        {\r\n            regKey.DeleteValue(strProcessName);\r\n            regKey.Close();\r\n        }\r\n    }\r\n}<\/pre>\n<p><a href=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2016\/12\/0002.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-290\" src=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2016\/12\/0002-300x226.png\" alt=\"\" width=\"300\" height=\"226\" srcset=\"https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0002-300x226.png 300w, https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0002-768x579.png 768w, https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0002.png 786w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u30ec\u30b8\u30b9\u30c8\u30ea\u306b\u767b\u9332\u3059\u308b\u30c7\u30fc\u30bf\u3092\u5909\u66f4\u3059\u308b\u3068\u3001\u4ed6\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3002<\/p>\n<p><a href=\"https:\/\/msdn.microsoft.com\/ja-jp\/library\/ee330730(v=vs.85).aspx#browser_emulation\" target=\"_blank\">MSDN\u00a0Internet Feature Controls (B..C) (Internet Explorer)<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u305f\u3001\u30ec\u30b8\u30b9\u30c8\u30ea\u3092\u4f7f\u7528\u305b\u305a\u3001Navigate\u30e1\u30bd\u30c3\u30c9\u306eadditionalHeaders\u306b\u3001\u76f4\u63a5UserAgent\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308b\u3002<\/p>\n<pre class=\"lang:c# decode:true \">using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows.Forms;\r\n\r\nnamespace WindowsFormsApplication1\r\n{\r\n    public partial class Form1 : Form\r\n    {\r\n        private const string strUserAgent = @\"User-Agent: Mozilla\/5.0 (Windows NT 10.0; WOW64; Trident\/7.0; rv:11.0) like Gecko\";\r\n\r\n        public Form1()\r\n        {\r\n            InitializeComponent();\r\n        }\r\n\r\n        private void Form1_Shown(object sender, EventArgs e)\r\n        {\r\n            webBrowser1.Navigate(\"http:\/\/www.useragentstring.com\/\", \"_self\", null, strUserAgent);\r\n        }\r\n    }\r\n}<\/pre>\n<p><a href=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2016\/12\/0003.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-293\" src=\"http:\/\/marius.main.jp\/software\/blog\/wp-content\/uploads\/2016\/12\/0003-300x226.png\" alt=\"\" width=\"300\" height=\"226\" srcset=\"https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0003-300x226.png 300w, https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0003-768x579.png 768w, https:\/\/todosoft.net\/blog\/wp-content\/uploads\/2016\/12\/0003.png 786w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System.Windows.Forms.WebBrowser\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u72b6\u614b\u3067\u306fIE7\u76f8\u5f53\u3002 \u78ba\u8a8d\u30b5\u30a4\u30c8\uff1aUser Agent String.Com using System; using System.Collec [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,15],"tags":[],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-c","category-15"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":5,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":296,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions\/296"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}