{"id":571,"date":"2009-08-10T18:49:00","date_gmt":"2009-08-10T10:49:00","guid":{"rendered":""},"modified":"2013-11-17T17:22:11","modified_gmt":"2013-11-17T09:22:11","slug":"delphi%e6%8e%a7%e5%88%b6%e5%8f%b0%e7%a8%8b%e5%ba%8f%e4%b8%8d%e6%98%be%e7%a4%ba%e6%8e%a7%e5%88%b6%e5%8f%b0%e7%aa%97%e5%8f%a3%e3%80%81%e5%af%86%e7%a0%81%e8%be%93%e5%85%a5%e7%94%a8%e6%98%9f%e5%8f%b7","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/571.html","title":{"rendered":"Delphi\u63a7\u5236\u53f0\u7a0b\u5e8f\u4e0d\u663e\u793a\u63a7\u5236\u53f0\u7a97\u53e3\u3001\u5bc6\u7801\u8f93\u5165\u7528\u661f\u53f7\u8868\u793a"},"content":{"rendered":"<p>\u600e\u6837\u8ba9Delphi \u5f00\u53d1\u7684\u63a7\u5236\u53f0\u7a0b\u5e8f\u4e0d\u663e\u793a\u63a7\u5236\u53f0\u7a97\u53e3\uff1f<\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a<\/p>\n<p>\u5728\u7a0b\u5e8f\u7684\u9996\u884c\u6dfb\u52a0 FreeConsole;<\/p>\n<p>FreeConsole \u662f Windows \u63d0\u4f9b\u7684 API \u51fd\u6570\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u9500\u6bc1 Console Window\uff0c\u4f46\u662f\u8fd9\u79cd\u65b9\u6cd5\u6709\u4e2a\u7f3a\u9677\uff0c\u5b83\u5fc5\u987b\u8981\u7b49 Console Window \u521b\u5efa\u540e\u624d\u80fd\u9500\u6bc1\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u5019\u8fd8\u662f\u4f1a\u6709\u4e00\u4e2a\u9ed1\u7a97\u53e3\u95ea\u4e00\u4e0b\uff0c\u7136\u540e\u5173\u95ed\u3002<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a<\/p>\n<p>\u76f4\u63a5\u5c06\u7f16\u8bd1\u6307\u4ee4 {$APPTYPE CONSOLE} \u53bb\u6389\u3002<br \/>\n\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83\u5b8c\u7f8e\uff0c\u4e0d\u4f1a\u51fa\u73b0 Console Window\u95ea\u73b0\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u600e\u6837\u4f7fdelphi\u5199\u7684\u63a7\u5236\u53f0\u7a0b\u5e8f\u5728\u4f7f\u7528\u4e2d\u5bc6\u7801\u4e0d\u663e\u793a\u51fa\u6765\uff1f<\/p>\n<p>\u600e\u6837\u8ba9Delphi \u5f00\u53d1\u7684\u63a7\u5236\u53f0\u7a0b\u5e8f\u4e0d\u663e\u793a\u63a7\u5236\u53f0\u7a97\u53e3\uff1f<\/p>\n<p>\u65b9\u6cd5\u4e00\uff1a<\/p>\n<p>\u5728\u7a0b\u5e8f\u7684\u9996\u884c\u6dfb\u52a0 FreeConsole;<\/p>\n<p>FreeConsole \u662f Windows \u63d0\u4f9b\u7684 API \u51fd\u6570\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u9500\u6bc1 Console Window\uff0c\u4f46\u662f\u8fd9\u79cd\u65b9\u6cd5\u6709\u4e2a\u7f3a\u9677\uff0c\u5b83\u5fc5\u987b\u8981\u7b49 Console Window \u521b\u5efa\u540e\u624d\u80fd\u9500\u6bc1\uff0c\u8fd9\u6837\u5c31\u5bfc\u81f4\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u5019\u8fd8\u662f\u4f1a\u6709\u4e00\u4e2a\u9ed1\u7a97\u53e3\u95ea\u4e00\u4e0b\uff0c\u7136\u540e\u5173\u95ed\u3002<\/p>\n<p>\u65b9\u6cd5\u4e8c\uff1a<\/p>\n<p>\u76f4\u63a5\u5c06\u7f16\u8bd1\u6307\u4ee4 {$APPTYPE CONSOLE} \u53bb\u6389\u3002<\/p>\n<p>\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83\u5b8c\u7f8e\uff0c\u4e0d\u4f1a\u51fa\u73b0 Console Window\u95ea\u73b0\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u600e\u6837\u4f7fdelphi\u5199\u7684\u63a7\u5236\u53f0\u7a0b\u5e8f\u5728\u4f7f\u7528\u4e2d\u5bc6\u7801\u4e0d\u663e\u793a\u51fa\u6765\uff1f<\/p>\n<pre class=\"brush: delphi; title: ; notranslate\" title=\"\">\r\n program   Project2;\r\n\r\n  {$APPTYPE   CONSOLE}\r\n\r\n  uses\r\n      SysUtils,Windows;\r\n\r\n  var\r\n      S   :   string;\r\n  begin\r\n      {   TODO   -oUser   -cConsole   Main   :   Insert   code   here   }\r\n      Write('Please   input   your   password:');\r\n      SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ENABLE_LINE_INPUT   or   ENABLE_PROCESSED_INPUT);\r\n      ReadLn(S);\r\n      WriteLn;\r\n      WriteLn('Your   Password   is:',S);\r\n      ReadLn;\r\n  end.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u600e\u6837\u8ba9Delphi \u5f00\u53d1\u7684\u63a7\u5236\u53f0\u7a0b\u5e8f\u4e0d\u663e\u793a\u63a7\u5236\u53f0\u7a97\u53e3\uff1f \u65b9\u6cd5\u4e00\uff1a \u5728\u7a0b\u5e8f\u7684\u9996\u884c\u6dfb\u52a0 FreeConsole;  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-571","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/571","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=571"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/571\/revisions"}],"predecessor-version":[{"id":4738,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/571\/revisions\/4738"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}