{"id":2070,"date":"2017-11-13T17:20:59","date_gmt":"2017-11-13T08:20:59","guid":{"rendered":"http:\/\/okamurax.com\/?p=2070"},"modified":"2017-11-13T17:20:59","modified_gmt":"2017-11-13T08:20:59","slug":"c-%e7%b6%99%e7%b6%9a%e3%81%97%e3%81%a6ping","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=2070","title":{"rendered":"C# \u7d99\u7d9a\u3057\u3066Ping"},"content":{"rendered":"<p>\u3061\u3087\u3063\u3068\u5b9f\u9a13\u306e\u305f\u3081\u3001\u7d99\u7d9a\u3057\u3066Ping\u3092\u6253\u3061\u7d9a\u3051\u308b\u3002<br \/>\ncmd.exe\u3067\u3082\u3044\u3044\u306e\u3060\u3051\u3069\u3001\u4e00\u5fdc\u30bf\u30b9\u30af\u30c8\u30ec\u30a4\u306b\u5e38\u99d0\u3002<\/p>\n<pre class=\"lang:c# decode:true\">using System;\r\nusing System.Windows.Forms;\r\n\r\nnamespace RepPing\r\n{\r\n    static class Program\r\n    {\r\n        \/\/\/ &lt;summary&gt;\r\n        \/\/\/ \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e1\u30a4\u30f3 \u30a8\u30f3\u30c8\u30ea \u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002\r\n        \/\/\/ &lt;\/summary&gt;\r\n        [STAThread]\r\n        static void Main()\r\n        {\r\n            NotifyIcon n = new NotifyIcon();\r\n            n.Visible = true;\r\n            n.Text = \"\";\r\n            n.Icon = System.Drawing.Icon.FromHandle((new System.Drawing.Bitmap(32, 32).GetHicon()));\r\n            n.DoubleClick += new EventHandler((object sender, EventArgs e) =&gt; {\r\n                Application.Exit();\r\n            });\r\n            Timer t = new Timer();\r\n            t.Interval = 3600000;\r\n            t.Tick += new EventHandler((object sender, EventArgs e)=&gt; {\r\n                var p = new System.Net.NetworkInformation.Ping();\r\n                var r = p.Send(\"192.168.1.1\");\r\n                n.Text = DateTime.Now.ToString(\"yyyy\/MM\/dd hh:mm:ss\") + \"\/\" + r.Status.ToString(); ;\r\n            });\r\n            t.Start();\r\n            Application.Run();\r\n        }\r\n    }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u3061\u3087\u3063\u3068\u5b9f\u9a13\u306e\u305f\u3081\u3001\u7d99\u7d9a\u3057\u3066Ping\u3092\u6253\u3061\u7d9a\u3051\u308b\u3002 cmd.exe\u3067\u3082\u3044\u3044\u306e\u3060\u3051\u3069\u3001\u4e00\u5fdc\u30bf\u30b9\u30af\u30c8\u30ec\u30a4\u306b\u5e38\u99d0\u3002 using System; using System.Windows.Forms; namespace Rep &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=2070\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;C# \u7d99\u7d9a\u3057\u3066Ping&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9],"class_list":["post-2070","post","type-post","status-publish","format-standard","hentry","category-1","tag-c-net"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2070"}],"version-history":[{"count":1,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2070\/revisions"}],"predecessor-version":[{"id":2071,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/2070\/revisions\/2071"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}