{"id":121904,"date":"2026-11-04T00:16:39","date_gmt":"2026-11-03T16:16:39","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/121904.html"},"modified":"2026-11-04T00:16:39","modified_gmt":"2026-11-03T16:16:39","slug":"%e4%bb%8e%e9%9b%b6%e6%90%ad%e5%bb%ba%e5%8d%8a%e5%af%bc%e4%bd%93%e8%ae%be%e5%a4%87%e4%b8%8a%e4%bd%8d%e6%9c%ba%ef%bc%88%e5%9b%9b%ef%bc%89%ef%bc%9a%e5%8d%95%e5%ae%9e%e4%be%8b%e3%80%81%e5%90%af%e5%8a%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/121904.html","title":{"rendered":"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48"},"content":{"rendered":"<h2>\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6&#xff1a;App \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48<\/h2>\n<p>\u8fd9\u662f\u300c\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\u300d\u7cfb\u5217\u7b2c4\u7bc7\u3002\u4e0a\u4e00\u7bc7\u8bb2\u4e86\u4e24\u5957 MVVM \u6846\u67b6\u600e\u4e48\u5206\u3002\u8fd9\u4e00\u7bc7\u62c6\u5f00\u90a3\u4e2a 526 \u884c\u7684 App.xaml.cs&#xff1a;\u542f\u52a8\u65f6\u5230\u5e95\u6309\u4ec0\u4e48\u987a\u5e8f\u505a\u4e8b\u3001\u4e24\u5957\u914d\u7f6e\u6587\u4ef6\u5404\u7ba1\u4ec0\u4e48\u3001\u4ee5\u53ca\u51e0\u4e2a&#034;\u770b\u8d77\u6765\u6ca1\u4e8b\u5176\u5b9e\u6709\u5751&#034;\u7684\u5199\u6cd5\u3002<\/p>\n<hr \/>\n<h3>\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u4e4b\u524d<\/h3>\n<p>\u4e0a\u4e00\u7bc7\u6211\u8bf4\u8fc7&#xff0c;RegisterTypes \u6709\u4e24\u767e\u884c\u3002\u90a3\u5269\u4e0b\u7684\u4e09\u767e\u591a\u884c\u5728\u5e72\u4ec0\u4e48&#xff1f;<\/p>\n<p>\u7b54\u6848\u662f&#xff1a;\u542f\u52a8\u6d41\u7a0b\u3002<\/p>\n<p>\u5de5\u63a7\u4e0a\u4f4d\u673a\u7684\u542f\u52a8\u6bd4\u666e\u901a\u684c\u9762\u8f6f\u4ef6\u9ebb\u70e6\u5f97\u591a\u3002\u666e\u901a\u8f6f\u4ef6\u542f\u52a8\u5931\u8d25&#xff0c;\u7528\u6237\u5173\u6389\u91cd\u5f00\u5c31\u884c\u3002\u8bbe\u5907\u4e0a\u7684\u4e0a\u4f4d\u673a\u542f\u52a8\u5931\u8d25&#xff0c;\u64cd\u4f5c\u5458\u7ad9\u5728\u673a\u5668\u524d&#xff0c;\u540e\u9762\u6392\u7740\u751f\u4ea7\u8ba1\u5212&#xff0c;\u4f60\u6ca1\u6cd5\u8ddf\u4ed6\u8bf4&#034;\u91cd\u542f\u8bd5\u8bd5&#034;\u2014\u2014\u542f\u52a8\u9636\u6bb5\u5fc5\u987b\u628a\u80fd\u60f3\u5230\u7684\u5931\u8d25\u90fd\u515c\u4f4f&#xff0c;\u5e76\u4e14\u7ed9\u51fa\u4eba\u8bdd\u7684\u9519\u8bef\u3002<\/p>\n<p>\u8fd9 526 \u884c\u91cc&#xff0c;\u771f\u6b63\u8ddf\u754c\u9762\u6709\u5173\u7684\u4e0d\u5230 50 \u884c&#xff0c;\u5269\u4e0b\u5168\u662f&#034;\u628a\u8bbe\u5907\u8fde\u4e0a\u3001\u628a\u914d\u7f6e\u8bfb\u5bf9\u3001\u628a\u65e5\u5fd7\u5f00\u8d77\u6765&#034;\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001OnStartup \u7684\u771f\u5b9e\u987a\u5e8f<\/h3>\n<p>\u5148\u770b\u4ee3\u7801\u91cc\u5b9e\u9645\u7684\u6267\u884c\u987a\u5e8f&#xff08;\u4e0d\u662f\u6559\u79d1\u4e66\u4e0a\u7684\u7406\u60f3\u987a\u5e8f&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u987a\u5e8f\u505a\u4ec0\u4e48\u5931\u8d25\u4f1a\u600e\u6837<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>\u51b3\u5b9a\u65e5\u5fd7\u76ee\u5f55<\/td>\n<td>\u5efa\u76ee\u5f55\u5931\u8d25 \u2192 \u6574\u4e2a\u542f\u52a8\u4e2d\u65ad<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>\u8bfb&#034;\u5f00\u53d1\u6807\u8bb0&#034;\u6587\u4ef6<\/td>\n<td>\u65e0&#xff08;\u53ea\u662f\u8bbe\u7f6e\u4e00\u4e2a\u5168\u5c40\u6807\u5fd7&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>\u8bfb AppConfig&#xff08;JSON&#xff09;<\/td>\n<td>\u89e3\u6790\u5931\u8d25 \u2192 \u5f39\u9519\u8bef\u6846\u540e\u9000\u51fa<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>\u8bfb \/ \u8865 Config.ini<\/td>\n<td>\u6587\u4ef6\u7f3a\u5931 \u2192 \u4ece\u5b89\u88c5\u76ee\u5f55\u590d\u5236\u4e00\u4efd\u9ed8\u8ba4\u7684<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>\u51b3\u5b9a ADS \u7684 NetID&#xff08;\u672c\u5730 \/ \u8fdc\u7a0b&#xff09;<\/td>\n<td>NetID \u4e3a\u7a7a \u2192 \u5f39\u914d\u7f6e\u786e\u8ba4\u6846<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>\u521b\u5efa\u5355\u5b9e\u4f8b Mutex<\/td>\n<td>\u5df2\u6709\u5b9e\u4f8b \u2192 \u63d0\u793a\u540e\u9000\u51fa<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>\u6ce8\u518c\u5168\u5c40\u5f02\u5e38\u5904\u7406<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>\u8fdb\u5165 Prism \u7684 CreateShell<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6574\u4e2a\u6d41\u7a0b\u5305\u5728\u4e00\u4e2a try\/catch \u91cc&#xff0c;catch \u91cc\u505a\u4e24\u4ef6\u4e8b&#xff1a;\u5199\u65e5\u5fd7\u3001\u5f39\u6846\u3001\u6e05\u7406\u8d44\u6e90\u3001Shutdown()\u3002<\/p>\n<h4>1.1 \u65e5\u5fd7\u76ee\u5f55\u4e0d\u662f\u56fa\u5b9a\u7684<\/h4>\n<p><span class=\"token class-name\"><span class=\"token keyword\">var<\/span><\/span> logRoot <span class=\"token operator\">&#061;<\/span> Path<span class=\"token punctuation\">.<\/span><span class=\"token function\">Combine<\/span><span class=\"token punctuation\">(<\/span>Golbal<span class=\"token punctuation\">.<\/span>WorkRootPath <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#064;&#034;\\\\Logs&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>File<span class=\"token punctuation\">.<\/span><span class=\"token function\">Exists<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#064;&#034;D:\\\\App\\\\RoboCell\\\\LogNet.tag&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    logRoot <span class=\"token operator\">&#061;<\/span> Path<span class=\"token punctuation\">.<\/span><span class=\"token function\">Combine<\/span><span class=\"token punctuation\">(<\/span>Golbal<span class=\"token punctuation\">.<\/span>LotRootNetPath <span class=\"token operator\">&#043;<\/span> <span class=\"token string\">&#064;&#034;\\\\Logs&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7b2c\u4e00\u884c\u662f\u9ed8\u8ba4&#xff1a;\u65e5\u5fd7\u5199\u5728\u8f6f\u4ef6\u81ea\u5df1\u7684\u5de5\u4f5c\u76ee\u5f55\u4e0b\u3002<br \/>\n\u7b2c\u4e8c\u884c\u662f\u4f8b\u5916&#xff1a;\u5982\u679c\u5b58\u5728\u67d0\u4e2a\u6807\u8bb0\u6587\u4ef6&#xff0c;\u65e5\u5fd7\u6539\u5199\u5230\u7f51\u7edc\u8def\u5f84\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u6709\u8fd9\u4e2a&#xff1f;\u56e0\u4e3a\u73b0\u573a\u8bbe\u5907\u88c5\u5728\u65e0\u5c18\u5ba4\u91cc&#xff0c;\u5de5\u7a0b\u5e08\u4e0d\u80fd\u968f\u4fbf\u8fdb\u53bb\u3002\u8bbe\u5907\u51fa\u95ee\u9898\u7684\u65f6\u5019&#xff0c;\u8981\u4e48\u7a7f\u65e0\u5c18\u670d\u8fdb\u53bb\u62f7\u65e5\u5fd7&#xff0c;\u8981\u4e48\u2014\u2014\u8ba9\u8f6f\u4ef6\u81ea\u5df1\u628a\u65e5\u5fd7\u5199\u5230\u7f51\u7edc\u76d8\u4e0a&#xff0c;\u5728\u5916\u9762\u770b\u3002<\/p>\n<p>\u4e00\u4e2a\u6807\u8bb0\u6587\u4ef6\u5c31\u5207\u6362\u4e86\u65e5\u5fd7\u843d\u70b9&#xff0c;\u6210\u672c\u6781\u4f4e&#xff0c;\u6536\u76ca\u6781\u5927\u3002\u8fd9\u4e2a\u8bbe\u8ba1\u540e\u6765\u88ab\u590d\u7528\u5230\u4e86\u597d\u51e0\u4e2a\u5730\u65b9\u3002<\/p>\n<h4>1.2 &#034;\u5f00\u53d1\u6807\u8bb0&#034;\u6587\u4ef6&#xff1a;\u7528\u6587\u4ef6\u7cfb\u7edf\u5f53\u914d\u7f6e\u5f00\u5173<\/h4>\n<p>Golbal<span class=\"token punctuation\">.<\/span>IsDevDebug <span class=\"token operator\">&#061;<\/span> File<span class=\"token punctuation\">.<\/span><span class=\"token function\">Exists<\/span><span class=\"token punctuation\">(<\/span>Path<span class=\"token punctuation\">.<\/span><span class=\"token function\">Combine<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#064;&#034;D:\\\\App\\\\RoboCell&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;dev.flag&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u6574\u4e2a\u5e94\u7528\u91cc&#xff0c;\u51e1\u662f&#034;\u5f00\u53d1\u65f6\u60f3\u8981\u3001\u751f\u4ea7\u65f6\u4e0d\u8981&#034;\u7684\u884c\u4e3a&#xff0c;\u90fd\u6302\u5728\u8fd9\u4e2a\u5e03\u5c14\u503c\u4e0a&#xff1a;<\/p>\n<ul>\n<li>\u9ed8\u8ba4\u542f\u52a8\u9875\u9762\u4e0d\u540c&#xff08;\u5f00\u53d1\u8fdb\u8c03\u8bd5\u754c\u9762&#xff0c;\u751f\u4ea7\u8fdb\u6b63\u5f0f\u754c\u9762&#xff09;<\/li>\n<li>\u90e8\u5206\u8c03\u8bd5\u6309\u94ae\u663e\u9690<\/li>\n<li>\u65e5\u5fd7\u7ea7\u522b<\/li>\n<\/ul>\n<p>\u4e3a\u4ec0\u4e48\u7528\u6587\u4ef6\u800c\u4e0d\u662f\u914d\u7f6e\u6587\u4ef6\u91cc\u7684\u4e00\u4e2a\u5b57\u6bb5&#xff1f;<\/p>\n<p>\u56e0\u4e3a\u6539\u914d\u7f6e\u6587\u4ef6\u8981\u91cd\u542f\u8f6f\u4ef6&#xff0c;\u800c\u73b0\u573a\u5de5\u7a0b\u5e08\u4e0d\u4e00\u5b9a\u77e5\u9053\u914d\u7f6e\u6587\u4ef6\u5728\u54ea\u3002\u653e\u4e00\u4e2a\u7a7a\u6587\u4ef6\u5728\u56fa\u5b9a\u8def\u5f84&#xff0c;\u8c01\u90fd\u80fd\u505a&#xff1a;\u8981\u5f00\u8c03\u8bd5\u5c31\u5efa\u6587\u4ef6&#xff0c;\u8981\u5173\u5c31\u5220\u6389\u3002<\/p>\n<p>\u4ee3\u4ef7\u662f\u8fd9\u4e2a\u884c\u4e3a\u5b8c\u5168\u4e0d\u53ef\u89c1\u2014\u2014\u4f60\u5728\u914d\u7f6e\u6587\u4ef6\u91cc\u627e\u4e0d\u5230\u5b83&#xff0c;\u53ea\u80fd\u8bfb\u4ee3\u7801\u624d\u77e5\u9053\u3002\u8fd9\u5c31\u662f\u7b2c 26 \u7bc7\u8981\u8bb2\u7684&#034;\u8c03\u8bd5\u6807\u8bb0\u7cfb\u7edf&#034;\u7684\u7531\u6765&#xff0c;\u4e5f\u662f\u5b83\u540e\u6765\u5fc5\u987b\u88ab\u6536\u53e3\u7684\u539f\u56e0\u3002<\/p>\n<h4>1.3 \u914d\u7f6e\u6587\u4ef6\u91cc\u7684&#034;\u521d\u59cb\u9875\u9762&#034;\u6c38\u8fdc\u4e0d\u751f\u6548<\/h4>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u503c\u5f97\u5355\u72ec\u770b&#xff1a;<\/p>\n<p><span class=\"token class-name\"><span class=\"token keyword\">var<\/span><\/span> programDefaultView <span class=\"token operator\">&#061;<\/span> CurAppConfig<span class=\"token punctuation\">.<\/span>DefaultView<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u5148\u5b58\u4ee3\u7801\u91cc\u7684\u9ed8\u8ba4\u503c<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span><span class=\"token keyword\">string<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">IsNullOrWhiteSpace<\/span><span class=\"token punctuation\">(<\/span>configStr<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    CurAppConfig <span class=\"token operator\">&#061;<\/span> JsonConvert<span class=\"token punctuation\">.<\/span><span class=\"token generic-method\"><span class=\"token function\">DeserializeObject<\/span><span class=\"token generic class-name\"><span class=\"token punctuation\">&lt;<\/span>AppConfig<span class=\"token punctuation\">&gt;<\/span><\/span><\/span><span class=\"token punctuation\">(<\/span>configStr<span class=\"token punctuation\">)<\/span><span class=\"token operator\">!<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    CurAppConfig<span class=\"token punctuation\">.<\/span>DefaultView <span class=\"token operator\">&#061;<\/span> programDefaultView<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u53cd\u5e8f\u5217\u5316\u5b8c\u518d\u8986\u76d6\u56de\u53bb<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u610f\u601d\u662f&#xff1a;JSON \u91cc\u5b58\u7684 DefaultView \u88ab\u4e22\u5f03&#xff0c;\u6c38\u8fdc\u7528\u4ee3\u7801\u91cc\u7b97\u51fa\u6765\u7684\u90a3\u4e2a\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48&#xff1f;\u56e0\u4e3a\u9ed8\u8ba4\u9875\u9762\u4f9d\u8d56 IsDevDebug&#xff1a;<\/p>\n<p><span class=\"token keyword\">public<\/span> <span class=\"token return-type class-name\"><span class=\"token keyword\">string<\/span><\/span> DefaultView <span class=\"token punctuation\">{<\/span> <span class=\"token keyword\">get<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">set<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">&#061;<\/span><br \/>\n    Golbal<span class=\"token punctuation\">.<\/span>IsDevDebug <span class=\"token punctuation\">?<\/span> ProcessView<span class=\"token punctuation\">.<\/span>ViewName <span class=\"token punctuation\">:<\/span> DesignView<span class=\"token punctuation\">.<\/span>ViewName<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5f00\u53d1\u6a21\u5f0f\u548c\u751f\u4ea7\u6a21\u5f0f\u8981\u8fdb\u4e0d\u540c\u9875\u9762\u3002\u5982\u679c\u5141\u8bb8\u914d\u7f6e\u6587\u4ef6\u8986\u76d6&#xff0c;\u5c31\u51fa\u73b0&#034;\u751f\u4ea7\u73af\u5883\u8bfb\u4e86\u5f00\u53d1\u73af\u5883\u7684\u914d\u7f6e&#xff0c;\u5f00\u673a\u8fdb\u8c03\u8bd5\u754c\u9762&#034;\u8fd9\u79cd\u4e8b\u2014\u2014\u73b0\u573a\u662f\u8981\u62a5\u6545\u969c\u7684\u3002<\/p>\n<p>\u6240\u4ee5\u8bbe\u8ba1\u4e0a\u76f4\u63a5\u5835\u6b7b&#xff1a;\u8fd9\u4e2a\u5b57\u6bb5\u53ea\u662f&#034;\u80fd\u88ab\u5e8f\u5217\u5316\u51fa\u53bb\u7ed9\u4eba\u770b&#034;&#xff0c;\u4e0d\u80fd\u88ab\u8bfb\u56de\u6765\u751f\u6548\u3002<\/p>\n<p>\u4ee3\u4ef7\u662f\u5b83\u5f88\u53cd\u76f4\u89c9\u3002\u540e\u6765\u6211\u5728\u5b57\u6bb5\u6ce8\u91ca\u91cc\u5199\u6e05\u695a\u4e86&#xff0c;\u4f46\u6ce8\u91ca\u8fd9\u79cd\u4e1c\u897f&#xff0c;\u6539\u4ee3\u7801\u7684\u4eba\u4e0d\u4e00\u5b9a\u770b\u3002<\/p>\n<hr \/>\n<h3>\u4e8c\u3001\u4e24\u5957\u914d\u7f6e\u6587\u4ef6&#xff0c;\u5206\u5de5\u662f\u660e\u786e\u7684<\/h3>\n<table>\n<tr>\u6587\u4ef6\u683c\u5f0f\u7ba1\u4ec0\u4e48\u8c01\u6539<\/tr>\n<tbody>\n<tr>\n<td>Configs\/AppConfig.json<\/td>\n<td>JSON<\/td>\n<td>\u7a97\u53e3\u5bbd\u9ad8\u3001\u662f\u5426\u6700\u5927\u5316\u3001\u521d\u59cb\u9875\u9762<\/td>\n<td>\u8f6f\u4ef6\u81ea\u5df1\u5199\u56de<\/td>\n<\/tr>\n<tr>\n<td>Config.ini<\/td>\n<td>INI<\/td>\n<td>PLC \u8fde\u63a5&#xff08;\u672c\u5730\/\u8fdc\u7a0b\u3001NetID\u3001\u7aef\u53e3&#xff09;\u3001\u6570\u636e\u5e93\u8bbf\u95ee\u6a21\u5f0f\u3001\u4f20\u611f\u5668\u8bfb\u53d6\u5ef6\u8fdf\u3001\u662f\u5426\u5f00\u673a\u81ea\u542f<\/td>\n<td>\u73b0\u573a\u5de5\u7a0b\u5e08\u624b\u6539<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261103161638-6aea08e61537c.png\" alt=\"\u4e24\u5957\u914d\u7f6e\u6587\u4ef6\u7684\u5206\u5de5\" \/><\/p>\n<h4>\u4e3a\u4ec0\u4e48\u4e0d\u7528\u4e00\u5957<\/h4>\n<p>\u56e0\u4e3a\u6539\u52a8\u9891\u7387\u548c\u8d23\u4efb\u4eba\u4e0d\u4e00\u6837\u3002<\/p>\n<p>\u7a97\u53e3\u5927\u5c0f\u662f&#034;\u7528\u6237\u62d6\u4e00\u4e0b\u5c31\u53d8&#034;&#xff0c;\u8f6f\u4ef6\u81ea\u5df1\u8bb0&#xff1b;PLC \u7684 NetID \u662f&#034;\u88c5\u673a\u65f6\u914d\u4e00\u6b21&#xff0c;\u4e4b\u540e\u53ea\u5728\u6362\u8bbe\u5907\u65f6\u6539&#034;&#xff0c;\u5fc5\u987b\u662f\u4eba\u624b\u6539&#xff0c;\u800c\u4e14\u5fc5\u987b\u662f\u7eaf\u6587\u672c\u3001\u80fd\u62ff\u8bb0\u4e8b\u672c\u6253\u5f00\u3002<\/p>\n<p>\u7528 JSON \u5b58 NetID&#xff0c;\u73b0\u573a\u5de5\u7a0b\u5e08\u6539\u9519\u4e00\u4e2a\u9017\u53f7&#xff0c;\u6574\u4e2a\u6587\u4ef6\u89e3\u6790\u5931\u8d25&#xff0c;\u8f6f\u4ef6\u8d77\u4e0d\u6765\u3002INI \u5bb9\u9519\u6027\u597d\u5f97\u591a\u2014\u2014\u5199\u9519\u4e86\u9876\u591a\u67d0\u4e2a\u952e\u8bfb\u4e0d\u5230\u3002<\/p>\n<p>\u5de5\u63a7\u8f6f\u4ef6\u7684\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u9009\u62e9&#xff0c;\u7b2c\u4e00\u539f\u5219\u662f&#034;\u4eba\u624b\u6539\u4e0d\u51fa\u81f4\u547d\u9519\u8bef&#034;&#xff0c;\u4e0d\u662f&#034;\u7ed3\u6784\u4f18\u96c5&#034;\u3002<\/p>\n<h4>\u6570\u636e\u5e93\u8bbf\u95ee\u6a21\u5f0f&#xff1a;\u4e00\u4e2a\u679a\u4e3e\u7ba1\u56db\u79cd\u73af\u5883<\/h4>\n<p>Config.ini \u91cc\u6709\u4e2a\u5b57\u6bb5\u63a7\u5236\u6570\u636e\u5e93\u8fde\u54ea&#xff1a;<\/p>\n<table>\n<tr>\u503c\u6a21\u5f0f\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>0<\/td>\n<td>Dev<\/td>\n<td>\u672c\u5730\u5f00\u53d1\u5e93<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>Test<\/td>\n<td>\u6d4b\u8bd5\u5e93<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Product_In<\/td>\n<td>\u751f\u4ea7\u6a21\u5f0f&#xff08;\u65e0\u5c18\u5ba4\u5185\u90e8\u7f51\u7edc&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Product_Out<\/td>\n<td>\u751f\u4ea7\u6a21\u5f0f&#xff08;\u5916\u90e8\u7f51\u7edc&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u540c\u4e00\u4e2a\u8f6f\u4ef6&#xff0c;\u56db\u79cd\u6570\u636e\u5e93\u843d\u70b9\u3002\u8fd9\u4e0d\u662f\u8bbe\u8ba1\u5f97\u6f02\u4eae&#xff0c;\u662f\u88ab\u7f51\u7edc\u73af\u5883\u903c\u51fa\u6765\u7684&#xff1a;\u65e0\u5c18\u5ba4\u5185\u7684\u7f51\u7edc\u548c\u5916\u9762\u7684\u7f51\u7edc\u4e0d\u901a&#xff0c;\u8bbe\u5907\u5728\u91cc\u9762\u8dd1&#xff0c;\u6570\u636e\u8981\u540c\u65f6\u7ed9\u91cc\u9762\u548c\u5916\u9762\u770b\u3002<\/p>\n<p>\u5207\u6362\u9760\u6539\u4e00\u4e2a\u6570\u5b57\u3002\u597d\u5904\u662f\u7b80\u5355&#xff1b;\u574f\u5904\u662f\u6539\u9519\u4e86\u6ca1\u4eba\u77e5\u9053\u2014\u2014\u8fde\u5230\u6d4b\u8bd5\u5e93&#xff0c;\u751f\u4ea7\u6570\u636e\u5199\u8fdb\u4e86\u6d4b\u8bd5\u8868&#xff0c;\u754c\u9762\u4e0a\u4e00\u5207\u6b63\u5e38\u3002<\/p>\n<p>\u540e\u6765\u52a0\u4e86\u4e00\u6761&#xff1a;\u542f\u52a8\u65f6\u628a\u5f53\u524d\u6570\u636e\u5e93\u6a21\u5f0f\u6253\u8fdb\u65e5\u5fd7\u7b2c\u4e00\u884c&#xff0c;\u5e76\u4e14\u663e\u793a\u5728\u72b6\u6001\u680f\u89d2\u843d\u3002\u8ba9&#034;\u8fde\u7684\u662f\u54ea\u4e2a\u5e93&#034;\u8fd9\u4ef6\u4e8b\u59cb\u7ec8\u53ef\u89c1\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001Mutex \u653e\u5728\u6700\u540e&#xff0c;\u662f\u4e2a\u771f\u5b9e\u9690\u60a3<\/h3>\n<p>\u5355\u5b9e\u4f8b\u9501\u662f\u8fd9\u4e48\u5199\u7684&#xff1a;<\/p>\n<p>IMutex <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token constructor-invocation class-name\">Mutex<\/span><span class=\"token punctuation\">(<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;RoboCell_Run_App&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>IMutex<span class=\"token punctuation\">.<\/span><span class=\"token function\">WaitOne<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">base<\/span><span class=\"token punctuation\">.<\/span><span class=\"token function\">OnStartup<\/span><span class=\"token punctuation\">(<\/span>e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    DispatcherUnhandledException <span class=\"token operator\">&#043;&#061;<\/span> App_DispatcherUnhandledException<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token keyword\">else<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    MessageBox<span class=\"token punctuation\">.<\/span><span class=\"token function\">Show<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u7a0b\u5e8f\u5df2\u7ecf\u542f\u52a8&#xff0c;\u53ea\u80fd\u8fd0\u884c\u4e00\u4e2a\u5b9e\u4f8b&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u63d0\u793a&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token range operator\">..<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">Shutdown<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u95ee\u9898\u5728\u4e8e&#xff1a;\u5b83\u5728\u914d\u7f6e\u8bfb\u53d6\u4e4b\u540e\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u7b2c\u4e8c\u4e2a\u5b9e\u4f8b\u542f\u52a8\u65f6&#xff0c;\u4f1a\u5148\u628a\u65e5\u5fd7\u76ee\u5f55\u5efa\u4e00\u904d\u3001\u8bfb\u4e00\u904d\u914d\u7f6e\u6587\u4ef6\u3001\u521d\u59cb\u5316\u4e00\u904d ADS \u53c2\u6570&#xff0c;\u7136\u540e\u624d\u53d1\u73b0&#034;\u5df2\u7ecf\u6709\u5b9e\u4f8b\u5728\u8dd1\u4e86&#034;\u3002<\/p>\n<p>\u540e\u679c\u6709\u4e09\u4e2a&#xff0c;\u90fd\u4e0d\u81f4\u547d\u4f46\u5f88\u70e6&#xff1a;<\/p>\n<li>\u7b2c\u4e8c\u4e2a\u5b9e\u4f8b\u4f1a\u5f80\u540c\u4e00\u4e2a\u65e5\u5fd7\u6587\u4ef6\u91cc\u5199\u51e0\u884c&#xff08;\u65e5\u5fd7\u6846\u67b6\u5141\u8bb8\u5171\u4eab\u5199&#xff0c;\u4f46\u5185\u5bb9\u4f1a\u4ea4\u9519&#xff09;\u3002<\/li>\n<li>\u5982\u679c\u914d\u7f6e\u6587\u4ef6\u635f\u574f&#xff0c;\u7b2c\u4e8c\u4e2a\u5b9e\u4f8b\u4f1a\u5148\u5f39&#034;\u914d\u7f6e\u8bfb\u53d6\u5931\u8d25&#034;&#xff0c;\u518d\u5f39&#034;\u5df2\u7ecf\u542f\u52a8&#034;&#xff0c;\u4e24\u4e2a\u6846\u53e0\u5728\u4e00\u8d77\u3002<\/li>\n<li>\u542f\u52a8\u6162\u2014\u2014\u8bfb\u4e86\u914d\u7f6e\u624d\u9000\u51fa&#xff0c;\u767d\u767d\u591a\u505a\u51e0\u767e\u6beb\u79d2\u3002<\/li>\n<p>\u6b63\u786e\u987a\u5e8f\u662f\u628a Mutex \u63d0\u5230\u6700\u524d\u9762&#xff0c;\u8fdb OnStartup \u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u62a2\u9501&#xff0c;\u62a2\u4e0d\u5230\u76f4\u63a5\u9000\u51fa\u3002<\/p>\n<p>\u5f53\u65f6\u6ca1\u8fd9\u4e48\u6539&#xff0c;\u662f\u56e0\u4e3a&#034;\u5148\u8bfb\u914d\u7f6e&#034;\u8fd9\u4e2a\u987a\u5e8f\u5df2\u7ecf\u8dd1\u4e86\u4e24\u5e74\u6ca1\u51fa\u8fc7\u4e8b\u2014\u2014\u6ca1\u51fa\u8fc7\u4e8b\u4e0d\u7b49\u4e8e\u6ca1\u95ee\u9898&#xff0c;\u53ea\u662f\u6ca1\u88ab\u89e6\u53d1\u8fc7\u3002<\/p>\n<hr \/>\n<h3>\u8e29\u5751\u8bb0\u5f55<\/h3>\n<h4>\u5751\u4e00&#xff1a;\u914d\u7f6e\u6587\u4ef6\u635f\u574f &#061; \u8f6f\u4ef6\u8d77\u4e0d\u6765<\/h4>\n<p>catch \u91cc\u662f\u8fd9\u4e48\u5904\u7406\u7684&#xff1a;<\/p>\n<p><span class=\"token keyword\">catch<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Exception<\/span> ex<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    AppLog<span class=\"token punctuation\">.<\/span><span class=\"token function\">Error<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bfb\u53d6App\u914d\u7f6e\u6587\u4ef6\u5931\u8d25&#xff0c;\u8bf7\u8054\u7cfb\u5f00\u53d1\u4eba\u5458&#xff01;&#034;<\/span><span class=\"token punctuation\">,<\/span> ex<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    MessageBox<span class=\"token punctuation\">.<\/span><span class=\"token function\">Show<\/span><span class=\"token punctuation\">(<\/span><span class=\"token interpolation-string\"><span class=\"token string\">$&#034;\u8bfb\u53d6App\u914d\u7f6e\u6587\u4ef6\u5931\u8d25&#8230;\\\\r\\\\n\u9519\u8bef\u4fe1\u606f&#xff1a;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token expression language-csharp\">ex<span class=\"token punctuation\">.<\/span>Message<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u9519\u8bef&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token range operator\">..<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">CleanupResources<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">Shutdown<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5408\u7406&#xff0c;\u4f46\u4e0d\u591f\u3002<\/p>\n<p>\u771f\u5b9e\u60c5\u51b5\u662f&#xff1a;\u914d\u7f6e\u6587\u4ef6\u635f\u574f\u4e4b\u540e&#xff0c;\u6bcf\u6b21\u542f\u52a8\u90fd\u5f39\u540c\u4e00\u4e2a\u6846\u7136\u540e\u9000\u51fa&#xff0c;\u64cd\u4f5c\u5458\u6ca1\u6709\u4efb\u4f55\u81ea\u6551\u624b\u6bb5\u2014\u2014\u4ed6\u4e0d\u77e5\u9053\u6587\u4ef6\u5728\u54ea\u3001\u4e5f\u4e0d\u77e5\u9053\u8be5\u5220\u54ea\u4e2a\u3002<\/p>\n<p>\u540e\u6765\u6539\u8fdb\u6210&#xff1a;\u914d\u7f6e\u6587\u4ef6\u89e3\u6790\u5931\u8d25\u65f6&#xff0c;\u81ea\u52a8\u5907\u4efd\u574f\u6587\u4ef6\u5e76\u56de\u9000\u5230\u9ed8\u8ba4\u914d\u7f6e&#xff0c;\u540c\u65f6\u5728\u754c\u9762\u4e0a\u7528\u7ea2\u8272\u6a2a\u5e45\u63d0\u793a&#034;\u914d\u7f6e\u5df2\u91cd\u7f6e&#xff0c;\u8bf7\u68c0\u67e5 PLC \u8fde\u63a5\u53c2\u6570&#034;\u3002<\/p>\n<p>\u539f\u5219\u662f&#xff1a;\u80fd\u8ba9\u8f6f\u4ef6\u8d77\u6765\u5c31\u5148\u8d77\u6765&#xff0c;\u8d77\u6765\u4e4b\u540e\u518d\u7528\u663e\u773c\u7684\u65b9\u5f0f\u544a\u8bc9\u4eba\u54ea\u91cc\u4e0d\u5bf9\u3002 \u4e00\u4e2a\u8fde\u754c\u9762\u90fd\u8fdb\u4e0d\u53bb\u7684\u8f6f\u4ef6&#xff0c;\u73b0\u573a\u53ea\u80fd\u53eb\u5de5\u7a0b\u5e08\u3002<\/p>\n<h4>\u5751\u4e8c&#xff1a;\u672c\u5730 PLC \u548c\u8fdc\u7a0b PLC \u8d70\u7684\u662f\u4e24\u6761\u8def<\/h4>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>AppIniConfig<span class=\"token punctuation\">.<\/span>IsLocalPlc<span class=\"token punctuation\">)<\/span><br \/>\n    _netID <span class=\"token operator\">&#061;<\/span> AmsNetId<span class=\"token punctuation\">.<\/span>Local<span class=\"token punctuation\">.<\/span><span class=\"token function\">ToString<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">else<\/span><br \/>\n    _netID <span class=\"token operator\">&#061;<\/span> AppIniConfig<span class=\"token punctuation\">.<\/span>PlcNetId<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u672c\u5730\u6a21\u5f0f\u4e0b NetID \u7528\u672c\u673a AMS \u5730\u5740&#xff0c;\u8fdc\u7a0b\u6a21\u5f0f\u7528\u914d\u7f6e\u91cc\u7684\u3002<\/p>\n<p>\u8fd9\u6761\u5206\u652f\u770b\u7740\u7b80\u5355&#xff0c;\u5b9e\u9645\u8e29\u8fc7&#xff1a;\u5f00\u53d1\u673a\u4e0a IsLocalPlc&#061;true&#xff0c;\u88c5\u673a\u65f6\u5fd8\u4e86\u6539&#xff0c;\u8f6f\u4ef6\u80fd\u8fde\u4e0a&#xff08;\u56e0\u4e3a\u5f00\u53d1\u673a\u4e0a\u4e5f\u88c5\u4e86 TwinCAT \u8fd0\u884c\u65f6&#xff09;&#xff0c;\u4f46\u8fde\u7684\u662f\u672c\u673a\u7684\u865a\u62df PLC&#xff0c;\u4e0d\u662f\u8bbe\u5907\u4e0a\u7684\u771f PLC\u3002<\/p>\n<p>\u73b0\u8c61\u662f&#xff1a;\u754c\u9762\u6570\u636e\u5168\u5728\u52a8&#xff0c;\u4f46\u90fd\u662f\u5047\u7684\u3002\u67e5\u4e86\u4e24\u5c0f\u65f6\u624d\u53cd\u5e94\u8fc7\u6765\u3002<\/p>\n<p>\u540e\u6765\u52a0\u4e86\u4e00\u6761\u542f\u52a8\u65e5\u5fd7&#xff1a;\u8fde\u63a5\u6210\u529f\u4e4b\u540e&#xff0c;\u628a\u5b9e\u9645\u7684 NetID \u548c\u7aef\u53e3\u6253\u5370\u51fa\u6765&#xff0c;\u5e76\u4e14\u548c\u914d\u7f6e\u6587\u4ef6\u91cc\u7684\u503c\u505a\u4e00\u6b21\u6bd4\u5bf9&#xff0c;\u4e0d\u4e00\u81f4\u5c31\u544a\u8b66\u3002<\/p>\n<h4>\u5751\u4e09&#xff1a;C:\\\\ \u4e0b\u7684\u8def\u5f84<\/h4>\n<p>\u65e9\u671f\u6240\u6709\u8def\u5f84\u90fd\u786c\u7f16\u7801\u5728 C:\\\\ \u4e0b&#xff08;\u65e5\u5fd7\u3001\u914d\u7f6e\u3001\u6807\u8bb0\u6587\u4ef6&#xff09;\u3002\u88c5\u673a\u65f6\u9047\u5230\u4e24\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<li>\u90e8\u5206\u8bbe\u5907\u7684\u7cfb\u7edf\u76d8\u5f00\u4e86\u8fd8\u539f&#xff0c;\u91cd\u542f\u540e C:\\\\ \u4e0b\u7684\u914d\u7f6e\u5168\u6ca1\u4e86\u3002<\/li>\n<li>\u6ca1\u6709\u7ba1\u7406\u5458\u6743\u9650\u65f6&#xff0c;\u5f80 C:\\\\ \u6839\u76ee\u5f55\u5199\u6587\u4ef6\u4f1a\u88ab\u62e6\u3002<\/li>\n<p>\u73b0\u5728\u7edf\u4e00\u632a\u5230\u4e86\u8f6f\u4ef6\u76ee\u5f55\u4e0b&#xff08;Golbal.WorkRootPath&#xff09;&#xff0c;\u53ea\u6709\u6807\u8bb0\u6587\u4ef6\u8fd8\u7559\u5728\u56fa\u5b9a\u8def\u5f84\u2014\u2014\u56e0\u4e3a\u5b83\u9700\u8981\u5728\u8f6f\u4ef6\u76ee\u5f55\u4e4b\u5916&#xff0c;\u5426\u5219\u91cd\u88c5\u8f6f\u4ef6\u4f1a\u628a\u5b83\u4e00\u8d77\u5220\u6389\u3002<\/p>\n<p>\u201c\u6807\u8bb0\u6587\u4ef6\u8981\u72ec\u7acb\u4e8e\u8f6f\u4ef6\u76ee\u5f55\u201d \u8fd9\u4e2a\u539f\u5219&#xff0c;\u662f\u4ece&#034;\u91cd\u88c5\u8f6f\u4ef6\u628a\u8c03\u8bd5\u5f00\u5173\u4e00\u8d77\u5220\u4e86\u3001\u7ed3\u679c\u751f\u4ea7\u73af\u5883\u8fdb\u4e86\u8c03\u8bd5\u754c\u9762&#034;\u90a3\u6b21\u4e8b\u6545\u4e4b\u540e\u5b9a\u4e0b\u7684\u3002<\/p>\n<hr \/>\n<h3>\u672c\u7bc7\u5c0f\u7ed3<\/h3>\n<li>\u542f\u52a8\u6d41\u7a0b\u7684\u987a\u5e8f\u662f\u6709\u8bb2\u7a76\u7684&#xff1a;\u65e5\u5fd7\u5148\u8d77\u3001\u914d\u7f6e\u540e\u8bfb\u3001\u9501\u8981\u6700\u5148\u62a2\u3002<\/li>\n<li>\u4e24\u5957\u914d\u7f6e\u6587\u4ef6\u6309&#034;\u8c01\u6539\u3001\u6539\u591a\u9891\u7e41&#034;\u5206&#xff1a;JSON \u7ed9\u8f6f\u4ef6\u5199&#xff0c;INI \u7ed9\u4eba\u6539&#xff0c;\u56e0\u4e3a\u4eba\u624b\u6539\u4e0d\u51fa\u81f4\u547d\u9519\u8bef\u66f4\u91cd\u8981\u3002<\/li>\n<li>\u6587\u4ef6\u7cfb\u7edf\u5f53\u5f00\u5173&#xff08;\u6807\u8bb0\u6587\u4ef6&#xff09;\u6210\u672c\u4f4e\u3001\u53ef\u89c1\u6027\u5dee&#xff0c;\u7528\u5b8c\u5fc5\u987b\u6709\u6536\u53e3\u673a\u5236\u3002<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6\u635f\u574f\u65f6\u7684\u6b63\u786e\u505a\u6cd5\u662f\u964d\u7ea7\u542f\u52a8&#xff0c;\u4e0d\u662f\u5f39\u6846\u9000\u51fa\u2014\u2014\u73b0\u573a\u6ca1\u4eba\u80fd\u6539\u4ee3\u7801\u3002<\/li>\n<p>\u4e0b\u4e00\u7bc7\u8fdb\u754c\u9762\u5c42\u3002\u4e09\u5957 UI \u5e93&#xff08;HandyControl\u3001MaterialDesign\u3001Wu.Wpf&#xff09;\u540c\u65f6\u88c5\u5728\u4e00\u4e2a WPF \u5e94\u7528\u91cc&#xff0c;\u6837\u5f0f\u5230\u5e95\u600e\u4e48\u4e0d\u6253\u67b6\u3002<\/p>\n<hr \/>\n<h3>\u4e0b\u671f\u9884\u544a<\/h3>\n<p>\u7b2c5\u7bc7&#xff1a;\u4e09\u5957 UI \u5e93\u5171\u5b58&#xff1a;HandyControl\u3001MaterialDesign\u3001Wu.Wpf \u7684\u6837\u5f0f\u57fa\u7ebf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6&#xff1a;App \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48\u8fd9\u662f\u300c\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\u300d\u7cfb\u5217\u7b2c4\u7bc7\u3002\u4e0a\u4e00\u7bc7\u8bb2\u4e86\u4e24\u5957 MVVM \u6846\u67b6\u600e\u4e48\u5206\u3002\u8fd9\u4e00\u7bc7\u62c6\u5f00\u90a3\u4e2a 526 \u884c\u7684 App.xaml.cs&#xff1a;\u542f\u52a8\u65f6\u5230\u5e95\u6309\u4ec0\u4e48\u987a\u5e8f\u505a\u4e8b\u3001\u4e24\u5957\u914d\u7f6e\u6587\u4ef6\u5404\u7ba1\u4ec0\u4e48\u3001\u4ee5\u53ca\u51e0\u4e2a\\&#8221;\u770b\u8d77\u6765\u6ca1\u4e8b\u5176\u5b9e\u6709\u5751\\&#8221;\u7684\u5199\u6cd5\u3002\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u4e4b\u524d<br \/>\n\u4e0a\u4e00\u7bc7\u6211\u8bf4\u8fc7&#xff0c;RegisterTypes \u6709\u4e24\u767e\u884c\u3002\u90a3\u5269\u4e0b\u7684\u4e09\u767e\u591a\u884c\u5728\u5e72\u4ec0\u4e48&#xff1f;<br \/>\n\u7b54\u6848\u662f&#xff1a;\u542f\u52a8\u6d41\u7a0b\u3002<br \/>\n\u5de5\u63a7\u4e0a<\/p>\n","protected":false},"author":2,"featured_media":121903,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[13952,1862,108],"topic":[],"class_list":["post-121904","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-13952","tag-wpf","tag-108"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/121904.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6&#xff1a;App \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48\u8fd9\u662f\u300c\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\u300d\u7cfb\u5217\u7b2c4\u7bc7\u3002\u4e0a\u4e00\u7bc7\u8bb2\u4e86\u4e24\u5957 MVVM \u6846\u67b6\u600e\u4e48\u5206\u3002\u8fd9\u4e00\u7bc7\u62c6\u5f00\u90a3\u4e2a 526 \u884c\u7684 App.xaml.cs&#xff1a;\u542f\u52a8\u65f6\u5230\u5e95\u6309\u4ec0\u4e48\u987a\u5e8f\u505a\u4e8b\u3001\u4e24\u5957\u914d\u7f6e\u6587\u4ef6\u5404\u7ba1\u4ec0\u4e48\u3001\u4ee5\u53ca\u51e0\u4e2a&quot;\u770b\u8d77\u6765\u6ca1\u4e8b\u5176\u5b9e\u6709\u5751&quot;\u7684\u5199\u6cd5\u3002\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u4e4b\u524d \u4e0a\u4e00\u7bc7\u6211\u8bf4\u8fc7&#xff0c;RegisterTypes \u6709\u4e24\u767e\u884c\u3002\u90a3\u5269\u4e0b\u7684\u4e09\u767e\u591a\u884c\u5728\u5e72\u4ec0\u4e48&#xff1f; \u7b54\u6848\u662f&#xff1a;\u542f\u52a8\u6d41\u7a0b\u3002 \u5de5\u63a7\u4e0a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/121904.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-03T16:16:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261103161638-6aea08e61537c.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121904.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/121904.html\",\"name\":\"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-03T16:16:39+00:00\",\"dateModified\":\"2026-11-03T16:16:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/121904.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/121904.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/121904.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/121904.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6&#xff1a;App \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48\u8fd9\u662f\u300c\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\u300d\u7cfb\u5217\u7b2c4\u7bc7\u3002\u4e0a\u4e00\u7bc7\u8bb2\u4e86\u4e24\u5957 MVVM \u6846\u67b6\u600e\u4e48\u5206\u3002\u8fd9\u4e00\u7bc7\u62c6\u5f00\u90a3\u4e2a 526 \u884c\u7684 App.xaml.cs&#xff1a;\u542f\u52a8\u65f6\u5230\u5e95\u6309\u4ec0\u4e48\u987a\u5e8f\u505a\u4e8b\u3001\u4e24\u5957\u914d\u7f6e\u6587\u4ef6\u5404\u7ba1\u4ec0\u4e48\u3001\u4ee5\u53ca\u51e0\u4e2a\"\u770b\u8d77\u6765\u6ca1\u4e8b\u5176\u5b9e\u6709\u5751\"\u7684\u5199\u6cd5\u3002\u6253\u5f00\u8fd9\u4e2a\u6587\u4ef6\u4e4b\u524d \u4e0a\u4e00\u7bc7\u6211\u8bf4\u8fc7&#xff0c;RegisterTypes \u6709\u4e24\u767e\u884c\u3002\u90a3\u5269\u4e0b\u7684\u4e09\u767e\u591a\u884c\u5728\u5e72\u4ec0\u4e48&#xff1f; \u7b54\u6848\u662f&#xff1a;\u542f\u52a8\u6d41\u7a0b\u3002 \u5de5\u63a7\u4e0a","og_url":"https:\/\/www.wsisp.com\/helps\/121904.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-03T16:16:39+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261103161638-6aea08e61537c.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/121904.html","url":"https:\/\/www.wsisp.com\/helps\/121904.html","name":"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-03T16:16:39+00:00","dateModified":"2026-11-03T16:16:39+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/121904.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/121904.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/121904.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4ece\u96f6\u642d\u5efa\u534a\u5bfc\u4f53\u8bbe\u5907\u4e0a\u4f4d\u673a\uff08\u56db\uff09\uff1a\u5355\u5b9e\u4f8b\u3001\u542f\u52a8\u6d41\u7a0b\u4e0e\u914d\u7f6e\u6587\u4ef6\uff0cApp \u91cc\u90a3 526 \u884c\u5230\u5e95\u5728\u5e72\u4ec0\u4e48"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=121904"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/121904\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/121903"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=121904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=121904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=121904"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=121904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}