{"id":1407,"date":"2011-07-29T15:37:35","date_gmt":"2011-07-29T08:37:35","guid":{"rendered":"http:\/\/www.todsapon.com\/story\/?p=1407"},"modified":"2019-07-29T15:40:34","modified_gmt":"2019-07-29T08:40:34","slug":"process-task-manager-java","status":"publish","type":"post","link":"http:\/\/www.todsapon.com\/story\/archive-blog\/process-task-manager-java","title":{"rendered":"\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a Process \u0e43\u0e19 Task Manager \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 Java"},"content":{"rendered":"<p><strong>\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07\u0e08\u0e32\u0e01\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e04\u0e17\u0e35\u0e48\u0e17\u0e33\u0e07\u0e32\u0e19<\/strong>\u00a0\u0e42\u0e14\u0e22\u0e42\u0e08\u0e17\u0e22\u0e4c\u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48\u0e27\u0e48\u0e32 \u0e43\u0e2b\u0e49\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e14\u0e39\u0e27\u0e48\u0e32\u0e43\u0e19\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e21\u0e35\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 saplogon.exe \u0e17\u0e33\u0e07\u0e32\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e2b\u0e21? \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e35\u0e48\u0e08\u0e30\u0e44\u0e14\u0e49\u0e17\u0e33 process \u0e2d\u0e37\u0e48\u0e19\u0e15\u0e48\u0e2d \u0e41\u0e27\u0e1a\u0e41\u0e23\u0e01\u0e19\u0e36\u0e01\u0e16\u0e36\u0e07 cmd Tasklist \u0e17\u0e35\u0e48\u0e44\u0e27\u0e49\u0e41\u0e2a\u0e14\u0e07 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 process \u0e43\u0e19 Task Manager \u0e02\u0e2d\u0e07\u0e17\u0e32\u0e07 windows<!--more--><\/p>\n<blockquote><p>\u0e40\u0e25\u0e22\u0e19\u0e33\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e19\u0e35\u0e49\u0e21\u0e32\u0e43\u0e0a\u0e49 \u0e1b\u0e31\u0e0d\u0e2b\u0e32\u0e04\u0e37\u0e2d \u0e41\u0e25\u0e49\u0e27\u0e21\u0e31\u0e19\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e22\u0e31\u0e07\u0e44\u0e07 \u0e01\u0e47\u0e40\u0e25\u0e22\u0e04\u0e49\u0e19\u0e2b\u0e32 google \u0e40\u0e08\u0e2d code \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e44\u0e14\u0e49 \u0e40\u0e08\u0e4b\u0e07!\u00a0 \u0e40\u0e25\u0e22\u0e19\u0e33\u0e21\u0e32\u0e1b\u0e23\u0e30\u0e22\u0e38\u0e01\u0e15\u0e4c \u0e42\u0e14\u0e22\u0e17\u0e35\u0e48 code \u0e21\u0e31\u0e19\u0e08\u0e30\u0e25\u0e39\u0e1b\u0e41\u0e2a\u0e14\u0e07 process \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 Buffered \u0e1c\u0e21\u0e01\u0e47\u0e40\u0e25\u0e22 \u0e14\u0e31\u0e01\u0e21\u0e31\u0e19\u0e14\u0e49\u0e27\u0e22 indexOf \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e21\u0e31\u0e19 \u0e16\u0e49\u0e32\u0e40\u0e08\u0e2d\u0e21\u0e31\u0e19\u0e08\u0e30\u0e43\u0e2b\u0e49\u0e04\u0e48\u0e32\u0e40\u0e17\u0e48\u0e32\u0e01\u0e31\u0e1a 0 \u0e41\u0e04\u0e48\u0e19\u0e35\u0e49\u0e01\u0e47\u0e40\u0e23\u0e35\u0e22\u0e1a\u0e23\u0e49\u0e2d\u0e22 \u0e40\u0e22\u0e35\u0e48\u0e22\u0e21\u0e46 \u0e08\u0e23\u0e34\u0e07\u0e46\u0e46\u00a0<img decoding=\"async\" class=\"emoji\" draggable=\"false\" src=\"https:\/\/s.w.org\/images\/core\/emoji\/11\/svg\/1f609.svg\" alt=\"\ud83d\ude09\" \/><\/p><\/blockquote>\n<p><strong>Code<\/strong><\/p>\n<pre class=\"brush:java\">try {\r\nString line;\r\nProcess p = Runtime.getRuntime().exec\r\n(System.getenv(\"windir\") +\"\\\\system32\\\\\"+\"tasklist.exe\");\r\nBufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));\r\n\r\nwhile ((line = input.readLine()) != null) {\r\nSystem.out.println(line);\u00a0\u00a0 \/\/\u0e41\u0e2a\u0e14\u0e07 Process \u0e17\u0e35\u0e48\u0e17\u0e33\u0e07\u0e32\u0e19\r\n\r\nint index = line.indexOf(\"saplogon.exe\");\r\nif (index == 0)\r\n{\r\nSystem.out.println(\"Yes, I found saplogon.exe.\");\r\n}\r\ninput.close();\r\n\r\n} catch (Exception err) {\r\nerr.printStackTrace();\r\n}\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0e17\u0e35\u0e48\u0e21\u0e32:\u00a0\u00a0<a href=\"http:\/\/stackoverflow.com\/questions\/54686\/how-to-get-a-list-of-current-open-windows-process-with-java\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">stackoverflow<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07\u0e08\u0e32\u0e01\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e04\u0e17\u0e35\u0e48\u0e17\u0e33\u0e07\u0e32\u0e19\u00a0\u0e42\u0e14\u0e22\u0e42\u0e08\u0e17\u0e22\u0e4c\u0e21\u0e35\u0e2d\u0e22\u0e39\u0e48\u0e27\u0e48\u0e32 \u0e43\u0e2b\u0e49\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e14\u0e39\u0e27\u0e48\u0e32\u0e43\u0e19\u0e04\u0e2d\u0e21\u0e1e\u0e34\u0e27\u0e40\u0e15\u0e2d\u0e23\u0e4c\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e31\u0e49\u0e19 \u0e21\u0e35\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 saplogon.exe \u0e17\u0e33\u0e07\u0e32\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e2b\u0e21? \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e17\u0e35\u0e48\u0e08\u0e30\u0e44\u0e14\u0e49\u0e17\u0e33 process \u0e2d\u0e37\u0e48\u0e19\u0e15\u0e48\u0e2d \u0e41\u0e27\u0e1a\u0e41\u0e23\u0e01\u0e19\u0e36\u0e01\u0e16\u0e36\u0e07 cmd Tasklist \u0e17\u0e35\u0e48\u0e44\u0e27\u0e49\u0e41\u0e2a\u0e14\u0e07 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 process \u0e43\u0e19 Task Manager \u0e02\u0e2d\u0e07\u0e17\u0e32\u0e07 windows<\/p>\n","protected":false},"author":1,"featured_media":970,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_options":[]},"categories":[384,250],"tags":[415,414],"class_list":["post-1407","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-archive-blog","category-programmer","tag-java","tag-task-manager"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"http:\/\/www.todsapon.com\/story\/wp-content\/uploads\/2018\/11\/programmer.jpg","jetpack_shortlink":"https:\/\/wp.me\/p5sZE6-mH","amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/posts\/1407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/comments?post=1407"}],"version-history":[{"count":1,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/posts\/1407\/revisions"}],"predecessor-version":[{"id":1408,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/posts\/1407\/revisions\/1408"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/media\/970"}],"wp:attachment":[{"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/media?parent=1407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/categories?post=1407"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.todsapon.com\/story\/wp-json\/wp\/v2\/tags?post=1407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}