{"id":48212,"date":"2024-10-07T19:39:16","date_gmt":"2024-10-07T11:39:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/48212\/"},"modified":"2024-10-07T19:39:16","modified_gmt":"2024-10-07T11:39:16","slug":"iis-%e5%85%a5%e9%96%80%ef%bc%9a%e7%82%ba%e9%81%8a%e6%88%b2%e5%8f%8d%e4%bd%9c%e5%bc%8a%e6%9c%8d%e5%8b%99%e9%85%8d%e7%bd%ae-iis","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/48212\/","title":{"rendered":"IIS \u5165\u9580\uff1a\u70ba\u904a\u6232\u53cd\u4f5c\u5f0a\u670d\u52d9\u914d\u7f6e IIS"},"content":{"rendered":"<h1 id=\"iis-%e5%85%a5%e9%96%80%ef%bc%9a%e7%82%ba%e9%81%8a%e6%88%b2%e5%8f%8d%e4%bd%9c%e5%bc%8a%e6%9c%8d%e5%8b%99%e9%85%8d%e7%bd%ae-iis-JFSIanySOc\">IIS \u5165\u9580\uff1a\u70ba\u904a\u6232\u53cd\u4f5c\u5f0a\u670d\u52d9\u914d\u7f6e IIS<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u904a\u6232\u74b0\u5883\u4e2d\uff0c\u53cd\u4f5c\u5f0a\u670d\u52d9\u7684\u9700\u6c42\u65e5\u76ca\u589e\u52a0\u3002\u9019\u4e9b\u670d\u52d9\u4e0d\u50c5\u80fd\u4fdd\u8b77\u904a\u6232\u7684\u516c\u5e73\u6027\uff0c\u9084\u80fd\u63d0\u5347\u73a9\u5bb6\u7684\u9ad4\u9a57\u3002\u5fae\u8edf\u7684 Internet Information Services (IIS) \u662f\u4e00\u500b\u5f37\u5927\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u9069\u5408\u7528\u65bc\u914d\u7f6e\u53cd\u4f5c\u5f0a\u670d\u52d9\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 IIS \u4e0a\u914d\u7f6e\u904a\u6232\u53cd\u4f5c\u5f0a\u670d\u52d9\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u5be6\u7528\u7684\u6b65\u9a5f\u548c\u7bc4\u4f8b\u3002<\/p>\n<h2 id=\"iis-%e7%b0%a1%e4%bb%8b-JFSIanySOc\">IIS \u7c21\u4ecb<\/h2>\n<p>IIS \u662f\u5fae\u8edf\u958b\u767c\u7684\u7db2\u9801\u4f3a\u670d\u5668\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc Windows \u74b0\u5883\u4e2d\u3002\u5b83\u652f\u6301\u591a\u7a2e\u7db2\u9801\u6280\u8853\uff0c\u5305\u62ec ASP.NET\u3001PHP \u548c HTML\u3002IIS \u7684\u53ef\u64f4\u5c55\u6027\u548c\u5b89\u5168\u6027\u4f7f\u5176\u6210\u70ba\u8a31\u591a\u4f01\u696d\u548c\u958b\u767c\u8005\u7684\u9996\u9078\u3002<\/p>\n<h2 id=\"%e7%82%ba%e4%bd%95%e9%81%b8%e6%93%87-iis-%e4%bd%9c%e7%82%ba%e5%8f%8d%e4%bd%9c%e5%bc%8a%e6%9c%8d%e5%8b%99%e7%9a%84%e4%bc%ba%e6%9c%8d%e5%99%a8-JFSIanySOc\">\u70ba\u4f55\u9078\u64c7 IIS \u4f5c\u70ba\u53cd\u4f5c\u5f0a\u670d\u52d9\u7684\u4f3a\u670d\u5668<\/h2>\n<ul>\n<li><strong>\u5b89\u5168\u6027\uff1a<\/strong> IIS \u63d0\u4f9b\u591a\u5c64\u5b89\u5168\u9632\u8b77\uff0c\u5305\u62ec\u8eab\u4efd\u9a57\u8b49\u548c\u6388\u6b0a\u6a5f\u5236\uff0c\u80fd\u6709\u6548\u9632\u6b62\u672a\u7d93\u6388\u6b0a\u7684\u8a2a\u554f\u3002<\/li>\n<li><strong>\u6027\u80fd\uff1a<\/strong> IIS \u80fd\u5920\u8655\u7406\u5927\u91cf\u7684\u4e26\u767c\u8acb\u6c42\uff0c\u9069\u5408\u9ad8\u6d41\u91cf\u7684\u904a\u6232\u74b0\u5883\u3002<\/li>\n<li><strong>\u6613\u65bc\u7ba1\u7406\uff1a<\/strong> IIS \u7684\u7ba1\u7406\u754c\u9762\u76f4\u89c0\uff0c\u4fbf\u65bc\u914d\u7f6e\u548c\u76e3\u63a7\u3002<\/li>\n<\/ul>\n<h2 id=\"%e9%85%8d%e7%bd%ae-iis-%e7%9a%84%e6%ad%a5%e9%a9%9f-JFSIanySOc\">\u914d\u7f6e IIS \u7684\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e5%ae%89%e8%a3%9d-iis-JFSIanySOc\">1. \u5b89\u88dd IIS<\/h3>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u4f60\u7684 Windows \u7cfb\u7d71\u5df2\u5b89\u88dd IIS\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>1. \u6253\u958b\u63a7\u5236\u9762\u677f\u3002\n2. \u9ede\u64ca\u201c\u7a0b\u5e8f\u201d\u3002\n3. \u9078\u64c7\u201c\u555f\u7528\u6216\u95dc\u9589 Windows \u529f\u80fd\u201d\u3002\n4. \u5728\u5217\u8868\u4e2d\u627e\u5230\u201cInternet Information Services\u201d\uff0c\u52fe\u9078\u4e26\u5b89\u88dd\u3002<\/code><\/pre>\n<h3 id=\"2-%e9%85%8d%e7%bd%ae%e7%b6%b2%e7%ab%99-JFSIanySOc\">2. \u914d\u7f6e\u7db2\u7ad9<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u6253\u958b IIS \u7ba1\u7406\u5668\uff0c\u4e26\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u914d\u7f6e\u7db2\u7ad9\uff1a<\/p>\n<pre><code>1. \u5728\u5de6\u5074\u7684\u9023\u63a5\u9762\u677f\u4e2d\uff0c\u53f3\u9375\u9ede\u64ca\u201c\u7db2\u7ad9\u201d\uff0c\u9078\u64c7\u201c\u6dfb\u52a0\u7db2\u7ad9\u201d\u3002\n2. \u8f38\u5165\u7db2\u7ad9\u540d\u7a31\u3001\u7269\u7406\u8def\u5f91\u548c\u7aef\u53e3\u865f\u3002\n3. \u9ede\u64ca\u201c\u78ba\u5b9a\u201d\u4ee5\u5275\u5efa\u7db2\u7ad9\u3002<\/code><\/pre>\n<h3 id=\"3-%e8%a8%ad%e7%bd%ae%e5%8f%8d%e4%bd%9c%e5%bc%8a%e6%9c%8d%e5%8b%99-JFSIanySOc\">3. \u8a2d\u7f6e\u53cd\u4f5c\u5f0a\u670d\u52d9<\/h3>\n<p>\u53cd\u4f5c\u5f0a\u670d\u52d9\u901a\u5e38\u9700\u8981\u8655\u7406\u4f86\u81ea\u904a\u6232\u5ba2\u6236\u7aef\u7684\u8acb\u6c42\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u7bc4\u4f8b\uff0c\u5c55\u793a\u5982\u4f55\u8a2d\u7f6e\u4e00\u500b\u57fa\u672c\u7684\u53cd\u4f5c\u5f0a API\uff1a<\/p>\n<pre><code>using System.Web.Http;\n\npublic class AntiCheatController : ApiController\n{\n    [HttpPost]\n    [Route(\"api\/anticheat\/validate\")]\n    public IHttpActionResult Validate([FromBody] CheatingData data)\n    {\n        \/\/ \u9a57\u8b49\u908f\u8f2f\n        if (IsCheating(data))\n        {\n            return BadRequest(\"\u4f5c\u5f0a\u884c\u70ba\u88ab\u6aa2\u6e2c\u5230\");\n        }\n        return Ok(\"\u9a57\u8b49\u6210\u529f\");\n    }\n\n    private bool IsCheating(CheatingData data)\n    {\n        \/\/ \u5be6\u73fe\u5177\u9ad4\u7684\u4f5c\u5f0a\u6aa2\u6e2c\u908f\u8f2f\n        return false; \/\/ \u5047\u8a2d\u6c92\u6709\u6aa2\u6e2c\u5230\u4f5c\u5f0a\n    }\n}\n\npublic class CheatingData\n{\n    public string PlayerId { get; set; }\n    public string GameData { get; set; }\n}<\/code><\/pre>\n<h3 id=\"4-%e9%85%8d%e7%bd%ae%e5%ae%89%e5%85%a8%e6%80%a7-JFSIanySOc\">4. \u914d\u7f6e\u5b89\u5168\u6027<\/h3>\n<p>\u70ba\u4e86\u4fdd\u8b77\u53cd\u4f5c\u5f0a\u670d\u52d9\uff0c\u5efa\u8b70\u555f\u7528 HTTPS\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u914d\u7f6e SSL \u8b49\u66f8\uff1a<\/p>\n<pre><code>1. \u5728 IIS \u7ba1\u7406\u5668\u4e2d\uff0c\u9078\u64c7\u4f60\u7684\u7db2\u7ad9\u3002\n2. \u9ede\u64ca\u201c\u7d81\u5b9a\u201d\u3002\n3. \u6dfb\u52a0 HTTPS \u7d81\u5b9a\uff0c\u4e26\u9078\u64c7 SSL \u8b49\u66f8\u3002<\/code><\/pre>\n<h2 id=\"%e6%b8%ac%e8%a9%a6%e8%88%87%e7%9b%a3%e6%8e%a7-JFSIanySOc\">\u6e2c\u8a66\u8207\u76e3\u63a7<\/h2>\n<p>\u914d\u7f6e\u5b8c\u6210\u5f8c\uff0c\u61c9\u9032\u884c\u6e2c\u8a66\u4ee5\u78ba\u4fdd\u53cd\u4f5c\u5f0a\u670d\u52d9\u6b63\u5e38\u904b\u884c\u3002\u53ef\u4ee5\u4f7f\u7528 Postman \u7b49\u5de5\u5177\u767c\u9001\u8acb\u6c42\uff0c\u6aa2\u67e5 API \u7684\u97ff\u61c9\u3002\u6b64\u5916\uff0c\u5b9a\u671f\u76e3\u63a7 IIS \u7684\u6027\u80fd\u548c\u5b89\u5168\u6027\uff0c\u4ee5\u4fbf\u53ca\u6642\u767c\u73fe\u554f\u984c\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-JFSIanySOc\">\u7e3d\u7d50<\/h2>\n<p>\u914d\u7f6e IIS \u4f5c\u70ba\u904a\u6232\u53cd\u4f5c\u5f0a\u670d\u52d9\u7684\u4f3a\u670d\u5668\u662f\u4e00\u500b\u6709\u6548\u7684\u89e3\u6c7a\u65b9\u6848\u3002\u901a\u904e\u6b63\u78ba\u7684\u5b89\u88dd\u548c\u914d\u7f6e\uff0cIIS \u80fd\u5920\u63d0\u4f9b\u7a69\u5b9a\u548c\u5b89\u5168\u7684\u74b0\u5883\uff0c\u4fdd\u8b77\u904a\u6232\u7684\u516c\u5e73\u6027\u3002\u82e5\u60a8\u9700\u8981\u9032\u4e00\u6b65\u7684\u652f\u6301\u6216\u5c0b\u627e\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u8cc7\u8a0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u70ba\u904a\u6232\u53cd\u4f5c\u5f0a\u670d\u52d9\u914d\u7f6eIIS\uff0c\u638c\u63e1\u57fa\u672c\u8a2d\u5b9a\u8207\u6700\u4f73\u5be6\u8e10\uff0c\u63d0\u5347\u904a\u6232\u5b89\u5168\u6027\u8207\u73a9\u5bb6\u9ad4\u9a57\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-48212","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=48212"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48212\/revisions"}],"predecessor-version":[{"id":48213,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/48212\/revisions\/48213"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=48212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=48212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=48212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}