{"id":68,"date":"2008-10-04T20:14:00","date_gmt":"2008-10-04T12:14:00","guid":{"rendered":""},"modified":"2013-11-19T22:00:23","modified_gmt":"2013-11-19T14:00:23","slug":"delphi%e7%ac%94%e8%ae%b0%e4%b8%80","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/68.html","title":{"rendered":"Delphi\u7b14\u8bb0[\u4e00]"},"content":{"rendered":"<p>Randomize;\u751f\u6210\u4e00\u4e2a\u968f\u673a\u6570<br \/>\nRandom (100);\u57280~100\u4e2d\u53d6\u4e00\u4e2a\u968f\u673a\u6570<br \/>\nUpperCase \u5c06\u76ee\u6807\u8f6c\u6362\u6210\u5927\u5199<br \/>\nSetWindowRgn API\u51fd\u6570\uff0c\u7528\u6765\u5b9e\u73b0\u4e0d\u89c4\u5219\u7a97\u53e3<br \/>\nExitWindows(0, 0);\u91cd\u542f\u8ba1\u7b97\u673a<br \/>\nShellExecute \u53c2\u8003\uff1ahttp:\/\/baike.baidu.com\/view\/1044533.htm<br \/>\nFileExists function FileExists(const FileName: string): Boolean; \u662f\u5426\u5b58\u5728\u8be5\u6587\u4ef6<br \/>\nDirectoryExists function DirectoryExists(const Directory: string): Boolean;\u662f\u5426\u5b58\u5728\u8be5\u76ee\u5f55<br \/>\nRectangle(x1,y1,x2,y2); \u753b\u77e9\u5f62<br \/>\nEllipse(x1,y1,x2,y2);\u753b\u692d\u5706<br \/>\nRdygon(p);\u753b\u591a\u8fb9\u5f62<br \/>\nGetCurrentDir;\u83b7\u5f97\u5f53\u524d\u76ee\u5f55\u540d<\/p>\n<pre class=\"brush: delphi; title: ; notranslate\" title=\"\">\r\nvar QQNumber:string;\r\nbegin\r\nif InputQuery(\u2018\u8f93\u5165\u4fe1\u606f\u2019,'\u8bf7\u8f93\u5165\u4e00\u4e2aQQ\u53f7\u7801\u2019,QQNumber)\r\nthen WebBrowser1.Navigate(\u2018http:\/\/wpa.qq.com\/msgrdv=1&amp;uin=\u2019+QQNumber+\u2019&amp;site=240zt\u2019);\r\nend;\r\n\r\nWebBrowser1.Navigate(\u2018http:\/\/wpa.qq.com\/msgrd?v=1&amp;uin=\u2019+InputBox(\u2018\u8f93\u5165\u4fe1\u606f\u2019,'\u8bf7\u8f93\u5165\u4e00\u4e2aQQ\u53f7\u7801:\u2019,\u2019810492306\u2032)+\u2019&amp;site=240zt\u2019);\r\n<\/pre>\n<p>\u5f97\u7f51\u7ad9\u6392\u540d\u7684\u4ee3\u7801<\/p>\n<pre class=\"brush: delphi; title: ; notranslate\" title=\"\">\r\nvar\r\np:integer;\r\ns:string;\r\nbegin\r\nWebBrowser1.Navigate(Edit1.Text);\r\ns := idHTTP1.Get(\u2018http:\/\/data.alexa.com\/data?cli=10&amp;dat=snba&amp;url=\u2019 + Edit1.Text) ;\r\n\/\/\u5148\u5f97\u5230\u7f51\u9875\u4ee3\u7801\r\np:=pos(\u2018\u201d TEXT=\u201d\u2018,s) + Length(\u2018\u201d TEXT=\u201d\u2018);\r\ns:=copy(s,P,30);\r\np:=pos(\u2018\u201d\/&gt;\u2019,s);\r\nLabel3.Caption:=Copy(s,1,P -1);\r\nif Edit1.Text=\u201d then\r\nShowMessage(\u2018\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a\u2019);\r\nend;\r\n<\/pre>\n<p>FindWindow\uff0cWin32 API\u51fd\u6570,\u53c2\u8003\uff1ahttp:\/\/baike.baidu.com\/view\/373605.htm<\/p>\n<p>SendMessage,Win32 API\u51fd\u6570,\u53c2\u8003\uff1ahttp:\/\/baike.baidu.com\/view\/1080187.htm<\/p>\n<p>ExtractFilePath(const FileName: string): string;\u8fd4\u56de\u8be5\u6587\u4ef6\u7684\u76ee\u5f55\u5168\u8def\u5f84<\/p>\n<p>\u7a97\u4f53\u7684\u4e00\u5c5e\u6027Alphablend\u53caAlphablendvalue\u5404\u8d77\u4ec0\u4e48\u4f5c\u7528\uff1f\u900f\u660e\u548c\u900f\u660e\u503c<\/p>\n<p>WindowFromPoint API\u51fd\u6570 \u53c2\u8003:http:\/\/baike.baidu.com\/view\/1080360.htm<\/p>\n<p>GetClassName API\u51fd\u6570 \u53c2\u8003:http:\/\/baike.baidu.com\/view\/1080266.htm<\/p>\n<p>GetWindowText API\u51fd\u6570 \u53c2\u8003:http:\/\/baike.baidu.com\/view\/1080327.html<\/p>\n<p>GetDlgltemText API\u51fd\u6570 \u53c2\u8003:http:\/\/baike.baidu.com\/view\/1079984.html<\/p>\n<p>GetCursorPos API\u51fd\u6570 \u53c2\u8003:http:\/\/baike.baidu.com\/view\/1079910.htm<\/p>\n<p>AnimateWindow \u8be5\u51fd\u6570\u80fd\u5728\u663e\u793a\u4e0e\u9690\u85cf\u7a97\u53e3\u65f6\u80fd\u4ea7\u751f\u7279\u6b8a\u7684\u6548\u679c<\/p>\n<p>CreatePolygonRgn API\u51fd\u6570,\u7ed3\u6784\u6307\u5b9a\u591a\u8fb9\u5f62 \u53c2\u8003\uff1a<\/p>\n<p>http:\/\/baike.360.cn\/wiki\/item\/CreatePolygonRgn<\/p>\n<p>SetWindowRgn API\u51fd\u6570\uff0c\u8bbe\u5b9a\u7a97\u6237\u7684\u7a97\u6237\u533a\u57df \u53c2\u8003\uff1a<\/p>\n<p>http:\/\/baike.baidu.com\/view\/1559429.htm<\/p>\n<p>ParamStr\uff080\uff09\u8fd4\u56de\u6267\u884c\u6587\u4ef6\u7684\u8def\u5f84\u548c\u6587\u4ef6\u540d\u3002<br \/>\n\u6bd4\u5982\u547d\u4ee4\u884c\uff1ac:\/temp\/MyApp.exe \\test \\save<br \/>\n\u90a3\u4e48\uff1a<br \/>\nparamstr[0] = \u2018c:\/temp\/MyApp.exe\u2019<br \/>\nparamstr[1] = \u2018\\test\u2019<br \/>\nparamstr[2] = \u2018\\save\u2019<\/p>\n<p>\u8865\u5145\uff1a\u8fd9\u91cc\u53ea\u662f\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u8fd9\u4e9b\u53c2\u6570\u5c31\u662f\u8981\u4f60\u7684\u7a0b\u5e8f\u5b9e\u73b0\u7684\u529f\u80fd\u554a\uff01<br \/>\n\u5982\u679c\u4f60\u7684\u7a0b\u5e8f\u6ca1\u6709\u5fc5\u8981\u4f7f\u7528\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u4e5f\u5c31\u6ca1\u6709\u610f\u4e49\u4e86\u3002<br \/>\nparamstr\u7684\u7528\u5904\u5c31\u662f\u5e2e\u4f60\u628a\u63a5\u6536\u5230\u7684\u547d\u4ee4\u4e2d\u7684\u53c2\u6570\u8bc6\u522b\u5206\u79bb\u51fa\u6765\uff0c\u597d\u8ba9\u4f60\u9488\u5bf9\u53c2\u6570\u8fdb\u884c\u7f16\u7a0b\u3002<\/p>\n<p>\u6587\u4ef6\u4e00\u4e9b\u64cd\u4f5c\u51fd\u6570\uff1a<br \/>\nExpandFileName(const FileName: string): string;\/\/\u4ece\u6587\u4ef6\u540d\u8fd4\u56de\u5b8c\u6574\u6587\u4ef6\u8def\u5f84\u540d<br \/>\nExtractFileDir(const FileName: string): string;\/\/\u4ece\u6587\u4ef6\u8def\u5f84\u540d\u4e2d\u8fd4\u56de\u76ee\u5f55\u8def\u5f84\u540d<br \/>\nExtractFileName(const FileName: string): string;\/\/\u4ece\u6587\u4ef6\u8def\u5f84\u540d\u4e2d\u8fd4\u56de\u6587\u4ef6\u540d\u548c\u6269\u5c55\u540d<br \/>\nExtractFileExt(const FileName: string): string;\/\/\u4ece\u6587\u4ef6\u8def\u5f84\u540d\u4e2d\u8fd4\u56de\u6269\u5c55\u540d<br \/>\nFileGetAttr(const FileName: string): Integer;\/\/\u8fd4\u56de\u6307\u5b9a\u6587\u4ef6\u5c5e\u6027<br \/>\nFileExists(const FileName: string): Boolean;\/\/\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728<br \/>\nFileCreate(const FileName: string): Integer; overload;\/\/\u521b\u5efa\u6587\u4ef6<br \/>\nDeleteFile(const FileName: string): Boolean;\/\/\u5220\u9664\u6307\u5b9a\u6587\u4ef6<br \/>\nRenameFile(const OldName, NewName: string): Boolean;\/\/\u91cd\u547d\u540d\u6307\u5b9a\u6587\u4ef6<br \/>\nGetCurrentDir: string;\/\/\u8fd4\u56de\u5f53\u524d\u76ee\u5f55\u8def\u5f84\u540d<br \/>\nSetCurrentDir(const Dir: string): Boolean;\/\/\u8bbe\u7f6e\u5f53\u524d\u76ee\u5f55<br \/>\nCreateDir(const Dir: string): Boolean;\/\/\u521b\u5efa\u65b0\u76ee\u5f55<\/p>\n<p>FileSetAttr(Edit1.Text+\u2019\\desktop.ini\u2019,faHidden);\/\/\u8bbe\u7f6e\u4e3a\u9690\u85cf\u5c5e\u6027\uff0c<\/p>\n<p>faReadOnly, faSysFile(\u7cfb\u7edf), faArchive(\u5b58\u6863), faHidden<\/p>\n<p>FileSetReadOnly(const FileName: string; ReadOnly: Boolean): Boolean;<\/p>\n<p>strpas \u51fd\u6570 \u5c06\u4ee5null\u7ed3\u675f\u7684\u5b57\u7b26\u4e32\u8f6c\u6362\u4e3apascal\u7c7b\u7684\u5b57\u7b26\u4e32,\u5c06pchar\u7c7b\u578b\u8f6c\u4e3astring\u7c7b\u578b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Randomize;\u751f\u6210\u4e00\u4e2a\u968f\u673a\u6570 Random (100);\u57280~100\u4e2d\u53d6\u4e00\u4e2a\u968f\u673a\u6570 UpperCase  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-my_notes"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/68","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=68"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":4860,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions\/4860"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}