{"id":28637,"date":"2024-11-25T17:02:59","date_gmt":"2024-11-25T09:02:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28637\/"},"modified":"2024-11-25T17:02:59","modified_gmt":"2024-11-25T09:02:59","slug":"delphiintraweb%e8%bf%9b%e8%a1%8c%e5%be%ae%e4%bf%a1%e5%bc%80%e5%8f%91-%e5%be%ae%e4%bf%a1%e5%b9%b3%e5%8f%b0%e6%8e%a5%e5%85%a5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28637\/","title":{"rendered":"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165"},"content":{"rendered":"<p>\u793a\u4f8b\u4ee3\u7801\u5df2\u7ecf\u653e\u51fa\uff01\u8bf7\u79fb\u6b65\u4f7f\u7528delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d11~4\u4ee3\u7801\u793a\u4f8b\u8fdb\u884c\u4e0b\u8f7d\uff0c\u867d\u4e3a\u793a\u4f8b\u4ee3\u7801\u4f46\u662f\u662f\u4ece\u6211\u9879\u76ee\u4e2d\u79fb\u51fa\u6765\u7684\uff0c\u5c01\u88c5\u5f88\u5b8c\u5907\u9002\u4e8e\u81ea\u884c\u6269\u5c55\u548c\u4fee\u6539\u3002&nbsp;<\/p>\n<p>iw14.0.50\u6765\u4e86\uff0c\u5728\u65b0\u7684\u7248\u672c\u4e2d\u6700\u5438\u5f15\u6211\u7684\u5c31\u662f\u589e\u52a0\u4e86\u5b8c\u5584\u7684httphandler\u529f\u80fd\uff1a\u7ec8\u4e8e\u53ef\u4ee5\u76f4\u63a5\u5728\u5730\u5740\u680f\u8f93\u5165url\u6253\u5f00iw\u529f\u80fd\u9875\u9762\u4e86\uff1b\u53ef\u4ee5\u81ea\u7531\u4f7f\u7528EasyUI\u7b49js\u6846\u67b6\u4e86\uff1b\u663e\u793a\u6a21\u5f0f\u5bf9\u8bdd\u6846\u4e5f\u4e0d\u518d\u4e03\u7ed5\u516b\u7ed5\u60f9\u4eba\u70e6\u4e86\uff1b\u5475\u5475\uff0c\u6211\u611f\u89c9iw\u7b2c\u4e00\u6b21\u63a5\u8fd1\u4e3b\u6d41web\u5f00\u53d1\u5de5\u5177\u4e86\uff01<\/p>\n<p>\u5174\u594b\u8fc7\u4e86\uff0c\u6765\u5c1d\u8bd5\u4e00\u4e0b\u5427\u3002\u5176\u5b9eiw\u7684\u5751\u8fd8\u662f\u633a\u591a\u7684\uff0c\u867d\u7136\u5df2\u7ecf\u63a5\u8fd1\u4e3b\u6d41\u4e86\uff0c\u4f46\u662f\uff0c\u540e\u9762\u6162\u6162\u90fd\u4f1a\u8bf4\u5230\u2026<\/p>\n<p>1\u3001\u65b0\u5efa\u4e00\u4e2aiw\u5de5\u7a0b\uff0c\u9009\u62e9Stand Alone Server \/ Service \uff0c\u8fd9\u79cd\u6a21\u5f0f\u4e0b\u8fdb\u884c\u5f00\u53d1\u662f\u6700\u7406\u60f3\u7684\uff0c\u8c03\u8bd5\u5f88\u65b9\u4fbf\uff0c\u6b63\u5f0f\u53d1\u5e03\u65f6\u53ef\u4ee5\u518d\u5efa\u7acb\u4e00\u4e2alibrary\u578b\u7684\u5de5\u7a0b\u53d1\u5e03\u5230.net\u670d\u52a1\u5668\u4e0a\u3002\uff08\u662f\u7684\uff0c\u5927\u5bb6\u6ca1\u6709\u770b\u9519\uff0c\u73b0\u5728iw\u5df2\u7ecf\u8131\u79bb\u4e86isapi\u6a21\u5f0f\uff0c\u53ef\u4ee5\u50cf\u90e8\u7f72.net mvc4\u5e94\u7528\u4e00\u6837\u90e8\u7f72\u5230iis\u4e0a\uff0c\u540e\u9762\u4f1a\u89e3\u91ca\uff0c.net\u865a\u62df\u4e3b\u673a\u4e5f\u53ef\u4ee5\u53d1\u5e03iw\u5e94\u7528\u4e86\uff01\u5de8\u5927\u7684\u8fdb\u6b65\u3002\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>2\u3001\u4fdd\u5b58\u5de5\u7a0b\u540e\u5728\u5de5\u7a0b\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u5355\u5143\u6587\u4ef6\uff0c\u4f8b\u5982\u8d77\u540d\u4e3awxapi.pas\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u5c06\u627f\u62c5\u5fae\u4fe1\u63a5\u5165\u5de5\u4f5c\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>interface <\/p>\n<p>uses &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; Classes,&nbsp;IW.Content.Base,&nbsp;System.SysUtils,HTTPApp,&nbsp;IWApplication, &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; IW.HTTP.Request,&nbsp;IW.HTTP.Reply; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>type &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/\/ <\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; \/\/\/ \u4eceTContentBase\u7ee7\u627f\u4e0b\u6765\u7684\u7c7b\uff0c\u5c31\u76f8\u5f53\u4e8easp.net\u4e2d\u7684httphandler &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; \/\/\/ &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; TWxApi&nbsp;=&nbsp;class(TContentBase) &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; protected &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp;&nbsp;&nbsp; function&nbsp;Execute(aRequest:&nbsp;THttpRequest;&nbsp;aReply:&nbsp;THttpReply;&nbsp;const&nbsp;aPathname:&nbsp;string;&nbsp;aSession:&nbsp;TIWApplication;&nbsp;aParams:&nbsp;TStrings):&nbsp;Boolean;&nbsp;override; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; public &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp;&nbsp;&nbsp; constructor&nbsp;Create;&nbsp;override; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; end; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>implementation &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>uses &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; ServerController,&nbsp;UserSessionUnit,&nbsp;Crypt.SHA1; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>{ TWxApi } &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>constructor&nbsp;TWxApi.Create; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>begin &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; inherited; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; \/\/ \u6587\u4ef6\u4e0d\u9700\u8981\u771f\u5b9e\u5b58\u5728 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; FileMustExist&nbsp;:=&nbsp;False; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>end; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>function&nbsp;TWxApi.Execute(aRequest:&nbsp;THttpRequest;&nbsp;aReply:&nbsp;THttpReply; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; const&nbsp;aPathname:&nbsp;string;&nbsp;aSession:&nbsp;TIWApplication; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; aParams:&nbsp;TStrings):&nbsp;Boolean; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>var &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; signature:&nbsp;string; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; timestamp:&nbsp;string; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; nonce:&nbsp;string; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; echostr:&nbsp;string; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; strs:&nbsp;TStringList; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; tmpStr:&nbsp;string; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>begin &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; Result&nbsp;:=&nbsp;True; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>&nbsp; signature&nbsp;:=&nbsp;aParams.Values[&#8216;signature&#8217;]; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; timestamp&nbsp;:=&nbsp;aParams.Values[&#8216;timestamp&#8217;]; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; nonce&nbsp;:=&nbsp;aParams.Values[&#8216;nonce&#8217;]; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; echostr&nbsp;:=&nbsp;aParams.Values[&#8216;echostr&#8217;]; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>&nbsp; strs&nbsp;:=&nbsp;TStringList.Create; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; strs.Add(&#8216;MyTestToken&#8217;);&nbsp;&nbsp;&nbsp; \/\/ Token\uff0c\u8981\u548c\u5fae\u4fe1\u63a5\u53e3\u914d\u7f6e\u4fe1\u606f\u4fdd\u6301\u4e00\u81f4 &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; strs.Add(timestamp); &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; strs.Add(nonce); &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; strs.Sort; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>&nbsp; tmpStr&nbsp;:=&nbsp;strs[0]+strs[1]+strs[2]; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; tmpStr&nbsp;:=&nbsp;SHA1(AnsiString(tmpstr)); &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>&nbsp; if&nbsp;tmpStr=signature&nbsp;then &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; begin &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp;&nbsp;&nbsp; aReply.WriteString(echostr) &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; end&nbsp;else&nbsp;begin &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp;&nbsp;&nbsp; aReply.WriteString(&#8216;\u5982\u679c\u770b\u5230\u8fd9\u4e2a\u63d0\u793a\u8bf4\u660e\u6b64\u94fe\u63a5\u5730\u5740\u53ef\u4f5c\u4e3a\u5fae\u4fe1\u63a5\u53e3\u5730\u5740\u4f7f\u7528\u3002&#8217;); &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; end; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>&nbsp; aSession.Terminate; \/\/ \u91ca\u653e\u4f1a\u8bdd\u8d44\u6e90\uff0c\u672chandler\u65e0\u9700\u4f1a\u8bdd &nbsp; &nbsp; &nbsp; &nbsp;<br \/>\n<br \/>end; &nbsp; &nbsp; &nbsp; &nbsp; <\/p>\n<p>end. <\/p>\n<p>\u5982\u4ee3\u7801\u6240\u793a\uff0cTContentBase\u5373iw\u7248httphandler\u7684\u57fa\u7840\u7c7b\uff0c\u5982\u679c\u4e0d\u9700\u8981\u663e\u793aiwForm\uff0c\u4ece\u8fd9\u4e2a\u7c7b\u578b\u7ee7\u627f\u4e0b\u6765\u5373\u53ef\u3002\u5982\u679c\u9700\u8981\u4f7f\u7528iwForm\u8fd8\u6709\u4e2aTContentForm\u57fa\u7840\u7c7b\u53ef\u4ee5\u4f7f\u7528\uff0c\u54c7\u54e6\uff0c\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165url\u4e5f\u53ef\u4ee5\u76f4\u63a5\u6253\u5f00iwform\u4e86\u54e6\u3002TWxApi.Execute\u4e2d\u7684\u4ee3\u7801\u5373\u5fae\u4fe1\u63a5\u5165\u7684\u4ee3\u7801\uff0c\u975e\u5e38\u7b80\u5355\uff0c\u4e0d\u4e86\u89e3\u7684\u770b\u770b\u5fae\u4fe1\u5e2e\u52a9\uff1a\u5fae\u4fe1\u63a5\u5165\u6307\u5357\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>3\u3001\u5728ServerController\u4e2d\u6ce8\u518c\u6b64httphandler\uff0c\u76f4\u63a5\u8d34\u51faServerController\u6ce8\u518c\u4ee3\u7801\uff1a &nbsp; &nbsp; &nbsp; <br \/>procedure&nbsp;TIWServerController.IWServerControllerBaseConfig(Sender:&nbsp;TObject); &nbsp; &nbsp; &nbsp; &nbsp; <br \/>begin &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ \u5728ServerController.OnConfig\u4e8b\u4ef6\u4e2d\u6ce8\u518c\u6211\u4eec\u5b9a\u4e49\u7684\u5fae\u4fe1Handler &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ ServerController.OnConfig\u4e8b\u4ef6\u5728\u6574\u4e2a\u5e94\u7528\u7a0b\u5e8f\u751f\u547d\u5468\u671f\u4e2d\u53ea\u88ab\u8fd0\u884c\u4e00\u6b21 &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; with&nbsp;THandlers.Add(&#8221;,&nbsp;&#8216;wxapi.php&#8217;,&nbsp;TWxApi.Create)&nbsp;do &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; begin &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp;&nbsp;&nbsp; CanStartSession&nbsp;:=&nbsp;True;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ \u4ece\u5b57\u9762\u4e0a\u7406\u89e3\u662f\u80fd\u591f\u542f\u52a8\u4f1a\u8bdd &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp;&nbsp;&nbsp; RequiresSessionStart&nbsp;:=&nbsp;False;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ \u4ece\u5b57\u9762\u4e0a\u7406\u89e3\u662f\u9700\u8981\u542f\u52a8\u4f1a\u8bdd\uff0c\u8fd9\u4e24\u4e2a\u5c5e\u6027\u5fc5\u987b\u8fdb\u884c\u8bbe\u7f6e\uff0c\u5426\u5219\u8f93\u5165 \/wxapi.php \u5c06\u8f6c\u5411\u4e3b\u7a97\u4f53 &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ \u4e5f\u5c31\u662f\u4e0d\u8bbe\u7f6eCanStartSession\u548cRequiresSessionStart\uff0c\u5219\u5fc5\u987b\u5148\u6267\u884c\/$\/start \u542f\u52a8\u4f1a\u8bdd\u540e\u624d &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/ \u80fd\u6b63\u5e38\u8bbf\u95ee \/wxapi.php\u9875\u9762\uff0c\u8fd9\u4e2a\u663e\u7136\u4e0d\u662f\u6211\u4eec\u9700\u8981\u7684\u3002 &nbsp; &nbsp; &nbsp; &nbsp; <br \/>&nbsp; end; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>end;<\/p>\n<p>\u5982\u4ee3\u7801\u6240\u793a\uff0c\u7ea2\u8272\u7684THandlers.Add(&#8221;,&nbsp;&#8216;wxapi.php&#8217;,&nbsp;TWxApi.Create)\u8fd9\u6bb5\u4ee3\u7801\u5c31\u5b8c\u6210\u4e86httphandler\u7684\u6ce8\u518c\uff0c\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u5373\u53ef\u8bbf\u95ee\u521a\u521a\u6ce8\u518c\u7684\u8fd9\u4e2a\u63a7\u5236\u5668\u3002<\/p>\n<p>\u4f46\u662f\u8fd9\u6bb5\u4ee3\u7801\u4e2d\u6709\u4e2a\u4e0d\u5927\u4e0d\u5c0f\u7684\u5751\uff0c\u8be6\u89c1\u6211\u4ee3\u7801\u4e2d\u7684\u6ce8\u91ca\u3002<\/p>\n<p>\u8fd9\u4e2a\u5751\u662fhandler\u6ce8\u518c\u540e\u542f\u52a8iw\u5e94\u7528\u4f46\u662f\u4e0d\u5148\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\/$\/start\u542f\u52a8\u7a0b\u5e8f\uff0c\u800c\u662f\u76f4\u63a5\u8f93\u5165\/wxapi.php\u9a8c\u8bc1httphandler\u65f6\u5931\u8d25\uff0c\u9875\u9762\u81ea\u52a8\u5bfc\u822a\u5230\u4e3b\u7a97\u4f53\uff01\u9605\u8bfb\u5e2e\u52a9\u540e\u53d1\u73b0\uff0c\u9700\u8981\u8bbe\u7f6eTContentBase.RequiresSessionStart:=false\u5426\u5219\u4f1a\u5bfc\u81f4iw\u5e94\u7528\u5fc5\u987b\u5148\u542f\u52a8\u4f1a\u8bdd\u8bbf\u95ee\u4e3b\u7a97\u4f53\u624d\u80fd\u4f7f\u7528httphandler\uff0c\u6309\u7167\u5e2e\u52a9\u7684\u8bf4\u660e\u8bbe\u7f6e\u4e86TContentBase.RequiresSessionStart:=false\u867d\u7136\u76f4\u63a5\u8f93\u5165\/wxapi.php\u4e0d\u518d\u5bfc\u822a\u5230\u4e3b\u7a97\u4f53\u4e86\uff0c\u4f46\u662f\u4f1a\u63d0\u793a404\u4ee3\u7801\u9519\u8bef\uff0c\u5355\u6b65\u8ddf\u8e2a\u53d1\u73b0httphandler\u4ee3\u7801\u786e\u5b9e\u5df2\u7ecf\u6267\u884c\u4e86\uff0c\u8fd9\u6837\u4e0d\u5e94\u8be5\u51fa\u73b0404\u9519\u8bef\uff0c\u591a\u65b9\u67e5\u8bc1\u548c\u5b9e\u9a8c\u53d1\u73b0\u8fd8\u9700\u8981\u8bbe\u7f6eTContentBase.CanStartSession&nbsp;:=&nbsp;True\uff0c\u5475\u5475\uff0c\u8fd9\u4e2a\u5728\u5e2e\u52a9\u4e2d\u6ca1\u6709\u63d0\u5230\uff0c\u4f30\u8ba1\u662f\u65b0\u7248\u672c\u65b0\u589e\u52a0\u7684\u5c5e\u6027\u3002\u597d\u4e86\uff0c\u73b0\u5728\u5728\u5730\u5740\u680f\u8f93\u5165\u80fd\u6b63\u5e38\u6253\u5f00\u9875\u9762\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/013\/5ada06ed0453d5eee5cb731a641f3872-0.png\" style=\"max-width:90%\" class=\"aligncenter\" title=\"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165\u63d2\u56fe\" alt=\"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165\u63d2\u56fe\" \/>&nbsp;<\/p>\n<p>4\u3001\u5c06\u7f16\u8bd1\u5b8c\u6210\u7684iw\u5e94\u7528\u62f7\u8d1d\u5230\u4e3b\u673a\u4e0a\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5b9e\u6218\u5fae\u4fe1\u63a5\u5165<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/013\/5ada06ed0453d5eee5cb731a641f3872-1.png\" style=\"max-width:90%\" class=\"aligncenter\" title=\"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165\u63d2\u56fe1\" alt=\"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165\u63d2\u56fe1\" \/>\uff0c\u5c45\u7136\u63d0\u793a\u914d\u7f6e\u5931\u8d25\uff01\u8fd9\u662f\u4ec0\u4e48\u60c5\u51b5\uff0c\u6211\u4f7f\u7528\u7684\u4ee3\u7801\u662f\u4ece\u522b\u4eba\u5199\u597d\u7684\u4e00\u4e2aDelphi\u7248\u5fae\u4fe1\u63a5\u5165\u63a5\u53e3\u4ee3\u7801\u4e2d\u62f7\u8d1d\u7684\uff0c\u90a3\u4e2a\u7a0b\u5e8f\u76f8\u540c\u7684\u4ee3\u7801\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u5f53\u65f6\u7b2c\u4e00\u4e2a\u5ff5\u5934\u662f\u9875\u9762\u7f16\u7801\u4e0d\u6b63\u786e\uff0c\u597d\u5427\uff0c\u6211\u6539\uff0ciw\u7684handler\u9ed8\u8ba4\u7684\u7f16\u7801\u662futf-8\u683c\u5f0f\u7684\uff0c\u4e8e\u662f\u6211\u5c1d\u8bd5\u4e86gbk\uff0ciso-8859-1\u7b49\u591a\u79cd\u7f16\u7801\u683c\u5f0f\uff0c\u5747\u63d0\u793a\u4e0a\u8ff0\u9519\u8bef\u3002\u4e07\u822c\u65e0\u5948\u53ea\u597d\u5199\u65e5\u5fd7\u770b\u770b\u5230\u5e95handler\u4ee3\u7801\u6267\u884c\u6ca1\u6709\uff0c\u7ed3\u679c\u4ee4\u4eba\u9707\u60ca\uff0c\u653e\u5230\u771f\u5b9e\u670d\u52a1\u5668\u4e0a\u540e\uff0c\u5fae\u4fe1\u9a8c\u8bc1\u65f6handler\u4ee3\u7801\u5c45\u7136\u6ca1\u6709\u6267\u884c\uff0c\u800c\u5728\u6211\u672c\u673a\u8c03\u8bd5\u65f6\u548c\u771f\u5b9e\u670d\u52a1\u5668\u7684\u6d4f\u89c8\u5668\u4e0a\u6d4f\u89c8\u65f6\u90fd\u5f88\u597d\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\u3002\u5de8\u5927\u7684\u5751\u554a\uff0c\u8fde\u7740\u597d\u51e0\u5929\u5404\u79cd\u6d4b\u8bd5\uff0c\u5404\u79cd\u4fee\u6539\uff0c\u90fd\u51c6\u5907\u653e\u5f03\u4e86\uff0c\u5475\u5475\uff0c\u7ed3\u679c\u770b\u4e86\u4e0biw\u81ea\u5df1\u7684httphandler\u793a\u4f8b\uff0c\u53d1\u73b0\u5728\u5176ServerController\u4e2d\u5b9e\u73b0\u4e86\u4e00\u4e2a\u4e8b\u4ef6\uff1aOnBrowserCheck\uff0c\u4e8e\u662f\u5c1d\u8bd5\u5728\u81ea\u5df1\u4ee3\u7801\u4e2d\u589e\u52a0\u4e86\u76f8\u540c\u4e8b\u4ef6\u4ee3\u7801\u8fdb\u884c\u6d4b\u8bd5\uff0c\u54c7\u585e\uff0c\u53ef\u4ee5\u4e86\u3002\u3002\u3002<\/p>\n<p>procedure&nbsp;TIWServerController.IWServerControllerBaseBrowserCheck( &nbsp; &nbsp; &nbsp; <br \/>&nbsp; aSession:&nbsp;TIWApplication;&nbsp;var&nbsp;rBrowser:&nbsp;TBrowser); &nbsp; &nbsp; &nbsp; <br \/>begin &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ \u8fd9\u4e2a\u4e8b\u4ef6\u4ee3\u7801\u5f88\u91cd\u8981\uff0c\u6211\u5728\u8fd9\u91cc\u5361\u4e86\u597d\u51e0\u5929\uff01&nbsp; <br \/>&nbsp; \/\/ &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ \u5728\u6ca1\u6709\u5b9e\u73b0\u8fd9\u4e2a\u4e8b\u4ef6\u7684\u65f6\u5019\uff0c\u5728\u4efb\u4f55\u6d4f\u89c8\u5668\u8f93\u5165 \/wxapi.php \u90fd\u80fd\u6210\u529f\u54cd\u5e94\uff0c\u552f\u72ec\u5230\u4e86 &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ \u5fae\u4fe1\u4e2d\u5c31\u663e\u793a\u914d\u7f6e\u5931\u8d25\uff0c\u540e\u6765\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u4e86\u65e5\u5fd7\u8f93\u51fa\u624d\u53d1\u73b0iw\u80fd\u6536\u5230\u5fae\u4fe1\u8bf7\u6c42\uff0c\u4f46\u662f &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ TWxApi.Execute\u65b9\u6cd5\u5374\u6ca1\u6709\u6267\u884c\uff0c\u540e\u6765\u53bb\u5b98\u7f51\u9605\u8bfb\u4e86\u76f8\u5173\u5e2e\u52a9\uff0c\u624d\u53d1\u73b0iw\u53ea\u6709\u652f\u6301\u7684\u6d4f &nbsp; &nbsp; &nbsp; <br \/>&nbsp; \/\/ \u89c8\u5668\u624d\u53ef\u6b63\u5e38\u54cd\u5e94\u8f93\u51fa\uff0c\u800c\u5fae\u4fe1\u53d1\u51fa\u7684web\u8bf7\u6c42\u663e\u7136\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u4e00\u4e2a\u5df2\u77e5\u7684\u6d4f\u89c8\u5668 &nbsp; &nbsp; &nbsp; <br \/>&nbsp; if&nbsp;rBrowser&nbsp;is&nbsp;TOther&nbsp;then&nbsp;begin &nbsp; &nbsp; &nbsp; <br \/>&nbsp;&nbsp;&nbsp; rBrowser.Free; &nbsp; &nbsp; &nbsp; <br \/>&nbsp;&nbsp;&nbsp; rBrowser&nbsp;:=&nbsp;TInternetExplorer.Create(8);&nbsp;\/\/ \u4ee5\u517c\u5bb9IE8\u9875\u9762\u6d4f\u89c8\u8fdb\u884c\u9875\u9762\u5185\u5bb9\u8f93\u51fa &nbsp; &nbsp; &nbsp; <br \/>&nbsp; end; &nbsp; &nbsp; &nbsp; <br \/>end;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/013\/79aeb4b264f74845c5ec9fce3b1271db-2.png\" style=\"max-width:90%\" class=\"aligncenter\" title=\"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165\u63d2\u56fe2\" alt=\"delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165\u63d2\u56fe2\" \/>\uff0c\u5475\u5475\uff0c\u592a\u4e0d\u5bb9\u6613\u4e86\uff0c\u5c31\u8fd9\u4e48\u51e0\u884c\u4ee3\u7801\u6298\u817e\u597d\u51e0\u5929\uff0c\u4e0d\u8fc7iw\u7ec8\u4e8e\u53ef\u4ee5\u7528\u4e8e\u5fae\u4fe1\u5f00\u53d1\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6211\u8ba4\u4e3aDelphi\u7684\u5f3a\u5927\u5728\u4e8e\u9664\u7f16\u8bd1\u5668\u5916\u6240\u6709\u6e90\u4ee3\u7801\u5747\u63d0\u4f9b\uff0c\u8fd9\u6837\u51fa\u73b0\u95ee\u9898\u4e86\u53ef\u4ee5\u901a\u8fc7\u9605\u8bfb\u6e90\u7801\u89e3\u51b3\uff0c\u4f46\u662fiw\u592a\u5c01\u95ed\u4e86\uff0c\u6ca1\u6709\u6e90\u7801\u5c31\u7b97\u4e86\uff0c\u5e2e\u52a9\u4e5f\u8ddf\u4e0d\u4e0a\uff0c\u5728\u7ebf\u90a3\u4e2a\u5e2e\u52a9\u5b9e\u5728\u592a\u592a\u592a\u5f31\u4e86\uff0c\u5efa\u8bae\u7528iw\u7684\u670b\u53cb\u7ed3\u5408\u5728\u7ebf\u5e2e\u52a9\u548ciw\u81ea\u5df1\u7684\u793a\u4f8b\u5de5\u7a0b\u4e00\u8d77\u770b\uff0c\u5c11\u8d70\u5f2f\u8def\uff01\u4e0d\u8fc7\uff0ciw\u53d1\u5c55\u5230\u4eca\u5929\u786e\u5b9e\u5df2\u7ecf\u633a\u597d\u7528\u4e86\uff0c\u5c24\u5176\u5bf9\u4e8e\u6709delphi\u60c5\u8282\u7684\u4eba\uff0c\u80fd\u7528\u81ea\u5df1\u6700\u64c5\u957f\u7684\u8bed\u8a00\u548c\u5f00\u53d1\u5de5\u5177\u8fdb\u884cweb\u5f00\u53d1\u771f\u662f\u633a\u723d\u7684\u4e00\u4ef6\u4e8b\u60c5\u3002<\/p>\n<p>&nbsp;\u66f4\u591adelphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d1-\u5fae\u4fe1\u5e73\u53f0\u63a5\u5165&nbsp;\u76f8\u5173\u6587\u7ae0\u8bf7\u5173\u6ce8PHP\u4e2d\u6587\u7f51\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u793a\u4f8b\u4ee3\u7801\u5df2\u7ecf\u653e\u51fa\uff01\u8bf7\u79fb\u6b65\u4f7f\u7528delphi+intraweb\u8fdb\u884c\u5fae\u4fe1\u5f00\u53d11~4\u4ee3\u7801\u793a\u4f8b\u8fdb\u884c\u4e0b\u8f7d\uff0c\u867d\u4e3a\u793a\u4f8b\u4ee3\u7801\u4f46\u662f\u662f\u4ece\u6211\u9879\u76ee\u4e2d\u79fb\u51fa\u6765\u7684\uff0c\u5c01\u88c5\u5f88\u5b8c\u5907\u9002\u4e8e\u81ea\u884c\u6269\u5c55\u548c\u4fee\u6539\u3002&nbsp; iw14.0.50\u6765\u4e86\uff0c\u5728\u65b0\u7684\u7248\u672c\u4e2d\u6700\u5438\u5f15\u6211\u7684\u5c31\u662f\u589e\u52a0\u4e86\u5b8c\u5584\u7684httphandler\u529f\u80fd\uff1a\u7ec8\u4e8e\u53ef\u4ee5\u76f4\u63a5\u5728\u5730\u5740\u680f\u8f93\u5165url\u6253\u5f00iw\u529f\u80fd\u9875\u9762\u4e86\uff1b\u53ef\u4ee5\u81ea\u7531\u4f7f\u7528EasyUI\u7b49js\u6846\u67b6\u4e86\uff1b\u663e\u793a\u6a21\u5f0f\u5bf9\u8bdd\u6846\u4e5f\u4e0d\u518d\u4e03\u7ed5\u516b\u7ed5\u60f9\u4eba\u70e6\u4e86\uff1b\u5475\u5475\uff0c\u6211\u611f\u89c9iw\u7b2c\u4e00\u6b21\u63a5\u8fd1\u4e3b\u6d41web\u5f00\u53d1\u5de5\u5177\u4e86\uff01 \u5174\u594b\u8fc7\u4e86\uff0c\u6765\u5c1d\u8bd5\u4e00\u4e0b\u5427\u3002\u5176\u5b9eiw\u7684\u5751\u8fd8\u662f\u633a\u591a\u7684\uff0c\u867d\u7136\u5df2\u7ecf\u63a5\u8fd1\u4e3b\u6d41\u4e86\uff0c\u4f46\u662f\uff0c\u540e\u9762\u6162\u6162\u90fd\u4f1a\u8bf4\u5230\u2026 1\u3001\u65b0\u5efa\u4e00\u4e2aiw\u5de5\u7a0b\uff0c\u9009\u62e9Stand Alone Server \/ Service \uff0c\u8fd9\u79cd\u6a21\u5f0f\u4e0b\u8fdb\u884c\u5f00\u53d1\u662f\u6700\u7406\u60f3\u7684\uff0c\u8c03\u8bd5\u5f88\u65b9\u4fbf\uff0c\u6b63\u5f0f\u53d1\u5e03\u65f6\u53ef\u4ee5\u518d\u5efa\u7acb\u4e00\u4e2alibrary\u578b\u7684\u5de5\u7a0b\u53d1\u5e03\u5230.net\u670d\u52a1\u5668\u4e0a\u3002\uff08\u662f\u7684\uff0c\u5927\u5bb6\u6ca1\u6709\u770b\u9519\uff0c\u73b0\u5728iw\u5df2\u7ecf\u8131\u79bb\u4e86isapi\u6a21\u5f0f\uff0c\u53ef\u4ee5\u50cf\u90e8\u7f72.net mvc4\u5e94\u7528\u4e00\u6837\u90e8\u7f72\u5230iis\u4e0a\uff0c\u540e\u9762\u4f1a\u89e3\u91ca\uff0c.net\u865a\u62df\u4e3b\u673a\u4e5f\u53ef\u4ee5\u53d1\u5e03iw\u5e94\u7528\u4e86\uff01\u5de8\u5927\u7684\u8fdb\u6b65\u3002\uff09 &nbsp; 2\u3001\u4fdd\u5b58\u5de5\u7a0b\u540e\u5728\u5de5\u7a0b\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u5355\u5143\u6587\u4ef6\uff0c\u4f8b\u5982\u8d77\u540d\u4e3awxapi.pas\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u5c06\u627f\u62c5\u5fae\u4fe1\u63a5\u5165\u5de5\u4f5c\u3002\u4ee3\u7801\u5982\u4e0b\uff1a interface uses &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Classes,&nbsp;IW.Content.Base,&nbsp;System.SysUtils,HTTPApp,&nbsp;IWApplication, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IW.HTTP.Request,&nbsp;IW.HTTP.Reply; &nbsp; &nbsp; &nbsp; &nbsp; type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\/ \u4eceTContentBase\u7ee7\u627f\u4e0b\u6765\u7684\u7c7b\uff0c\u5c31\u76f8\u5f53\u4e8easp.net\u4e2d\u7684httphandler &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-28637","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=28637"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28637\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}