{"id":981,"date":"2018-09-17T19:01:45","date_gmt":"2018-09-17T10:01:45","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=981"},"modified":"2018-12-23T01:50:32","modified_gmt":"2018-12-22T16:50:32","slug":"inetaddress-getlocalhost","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/th\/\u0e1a\u0e25\u0e47\u0e2d\u0e01\/java\/inetadress-getlocalhost","title":{"rendered":"\u0e23\u0e31\u0e1a\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49 Java"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\">\u0e23\u0e31\u0e1a\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49 Java<\/a><br \/><strong>InetAddress.getLocalHost().getHostName()<\/strong><\/h2>\n<p>\n\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e17\u0e33\u0e07\u0e32\u0e19\u0e1a\u0e19 Java<strong>\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c<\/strong>(<strong>\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07<\/strong>) \u0e21\u0e35\u0e01\u0e32\u0e23\u0e41\u0e19\u0e30\u0e19\u0e33\u0e17\u0e35\u0e48\u0e19\u0e35\u0e48<br \/>\n\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e27\u0e34\u0e18\u0e35\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49\n<\/p>\n<div class=\"point\">\n<ul>\n<li><strong>java.net.InetAddress.getLocalHost()<\/strong> \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e31\u0e27\u0e41\u0e17\u0e19\u0e02\u0e2d\u0e07\u0e40\u0e08\u0e49\u0e32\u0e20\u0e32\u0e1e\u0e17\u0e49\u0e2d\u0e07\u0e16\u0e34\u0e48\u0e19\u0e42\u0e14\u0e22 <strong>InetAddress<\/strong> \u0e23\u0e31\u0e1a\u0e2d\u0e34\u0e19\u0e2a\u0e41\u0e15\u0e19\u0e0b\u0e4c\u0e02\u0e2d\u0e07 .<\/li>\n<li>\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e40\u0e08\u0e49\u0e32\u0e20\u0e32\u0e1e\u0e17\u0e49\u0e2d\u0e07\u0e16\u0e34\u0e48\u0e19 <strong>InetAddress<\/strong> \u0e02\u0e2d\u0e07 <strong>getHostName()<\/strong> \u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e44\u0e14\u0e49\u0e21\u0e32\u0e08\u0e32\u0e01<\/li>\n<\/ul>\n<\/div>\n<h2 class=\"common_title\"><a name=\"1\">\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07<\/a><\/h2>\n<pre class=\"sample_src\">\/** * \u0e23\u0e31\u0e1a\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e23\u0e31\u0e19\u0e2d\u0e22\u0e39\u0e48 * @return \u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c * *\u0e2b\u0e32\u0e01\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e22\u0e01\u0e40\u0e27\u0e49\u0e19\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e04\u0e32\u0e14\u0e04\u0e34\u0e14\u0e40\u0e01\u0e34\u0e14\u0e02\u0e36\u0e49\u0e19 \u0e2a\u0e15\u0e23\u0e34\u0e07 &quot;UnknownHost&quot; \u0e08\u0e30\u0e16\u0e39\u0e01\u0e2a\u0e48\u0e07\u0e01\u0e25\u0e31\u0e1a *\/ public static String getHostName() { try { return InetAddress.getLocalHost().getHostName(); }catch (\u0e02\u0e49\u0e2d\u0e22\u0e01\u0e40\u0e27\u0e49\u0e19 e) { e.printStackTrace(); } return &quot;UnknownHost&quot;; }\r\n<\/pre>\n<p><script type=\"text\/javascript\" src=\"https:\/\/chat-messenger.com\/js\/common.js?dd12sssas2223\" charset=\"UTF-8\"><\/script><br \/>\n<script type=\"text\/javascript\"> writePR(); <\/script><\/p>\n<h2 class=\"common_title\"><a name=\"2\">\u0e1c\u0e25\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/a><\/h2>\n<p>\u25c6\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/p>\n<pre class=\"sample_src\">\/** * \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23 * @param args *\/ public static void main(String[] args) { String name = getHostName(); System.out.println(&quot;Host name = &#039;&quot;+name+&quot;&#039;&quot;); }\r\n<\/pre>\n<p>\u25c6\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e40\u0e2d\u0e32\u0e17\u0e4c\u0e1e\u0e38\u0e15<\/p>\n<pre class=\"console\">\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c = &#039;******ATTON&#039;\r\n<\/pre>\n<p>*\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e19\u0e31\u0e49\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e2d\u0e32\u0e15\u0e4c\u0e1e\u0e38\u0e15\u0e08\u0e23\u0e34\u0e07\u0e46<\/p>","protected":false},"excerpt":{"rendered":"<p>\u0e23\u0e31\u0e1a\u0e0a\u0e37\u0e48\u0e2d\u0e42\u0e2e\u0e2a\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49 Java InetAddress.getLocalHost().getHos [\u2026]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts\/981"}],"collection":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/comments?post=981"}],"version-history":[{"count":4,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts\/981\/revisions"}],"predecessor-version":[{"id":1870,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts\/981\/revisions\/1870"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/media?parent=981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/categories?post=981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/tags?post=981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}