{"id":1104,"date":"2022-04-06T13:36:34","date_gmt":"2022-04-06T05:36:34","guid":{"rendered":"https:\/\/blog.5danyuan.com\/?p=1104"},"modified":"2022-04-06T13:36:34","modified_gmt":"2022-04-06T05:36:34","slug":"net-6-%e4%bd%bf%e7%94%a8-winform-api","status":"publish","type":"post","link":"https:\/\/blog.5danyuan.com\/?p=1104","title":{"rendered":".Net 6 \u4f7f\u7528 Winform API"},"content":{"rendered":"\n<p>\u6700\u8fd1\u7684\u9879\u76ee\u5728\u8ba1\u5212\u5207\u6362\u5230\u4f7f\u7528 .net6 \u6765\u7f16\u8bd1\uff0c\u867d\u7136\u5fae\u8f6f\u5b98\u7f51\u6709\u63d0\u4f9b\u8f6c\u6362\u5de5\u5177\uff0c\u4f46\u662f\u4f5c\u4e3a\u5f3a\u8feb\u75c7\u4eba\u7fa4\uff0c\u8fd8\u662f\u9009\u62e9\u4e86\u4ece0\u5f00\u59cb\u521b\u5efa\u9879\u76ee\uff0c\u5728\u521b\u5efa\u540e\uff0c\u518d\u62f7\u8d1d\u76f8\u5173\u4ee3\u7801\u3002<\/p>\n\n\n\n<p>\u5f88\u663e\u7136\u7684\uff0c\u6709\u4e00\u4e9b\u51fd\u6570\u6216\u8005\u547d\u540d\u7a7a\u95f4\u5728 .net6\u91cc\u5e76\u65e0\u6cd5\u627e\u5230\u5bf9\u5e94\u7684\uff0c\u5b98\u65b9\u4e5f\u63d0\u53ca\uff0c\u53ef\u4ee5\u5148\u8bd5\u4e00\u8bd5 Microsoft.Windows.Compatibility \u8fd9\u4e2a NuGet \u5305\u3002VS2022 \u7684\u53f3\u952e\u83dc\u5355\u91cc\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f88\u5b9e\u7528\u7684\u529f\u80fd\uff0c\u5c31\u662f\u79fb\u9664\u672a\u4f7f\u7528\u7684\u5f15\u7528\uff0c\u6240\u4ee5\u5927\u5bb6\u53ef\u4ee5\u653e\u5fc3\u5730\u5148\u5f15\u7528\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u7684\u9879\u76ee\u4f7f\u7528\u4e86\u6ce8\u518c\u8868\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u6dfb\u52a0 Microsoft.Win32.Registry \u8fd9\u4e2a NuGet \u5305\u3002<\/p>\n\n\n\n<p>\u5f88\u53ef\u60dc\uff0c\u6211\u7684\u4ee3\u7801\u91cc\u4f7f\u7528\u4e86 System.Windows.Forms \u7684API\u53bb\u5224\u65ad\u7535\u6e90\u662f DC \u8fd8\u662f AC \u6a21\u5f0f\uff0c\u4e0a\u8ff0\u90fd\u6ca1\u6709\u5f88\u597d\u5730\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n\n\n\n<p>\u7ecf\u8fc7\u4e00\u756a\u641c\u7d22\uff0c\u53d1\u73b0\u4e0b\u9762\u7684\u89e3\u51b3\u65b9\u5f0f\uff0c<br>1\u3001\u53f3\u952e\u5378\u8f7d\u9879\u76ee<br>2\u3001\u7f16\u8f91\u9879\u76ee\u7684 csproj \u6587\u4ef6\uff0c\u5728 PropertyGroup \u8282\u70b9\u4e0b\u6dfb\u52a0 true\u548ctrue \u8fd9\u4e24\u4e2a\u914d\u7f6e\u3002<br>3\u3001\u8bbe\u7f6e .net6.0\u5c5e\u6027\uff0c\u66ff\u6362\u4e3a .net6.0-windows\uff0c\u5982\u679c\u6709\u5176\u5b83\u7684\u7f16\u8bd1\u9700\u6c42\uff0c\u4f8b\u5982 net461\u4e5f\u53ef\u4ee5\u52a0\u8fdb\u53bb\uff0c\u4ee5\u82f1\u6587\u5206\u53f7\u5206\u5272\u3002<br>4\u3001\u91cd\u65b0\u52a0\u8f7d\u9879\u76ee<\/p>\n\n\n\n<p>\u5f53\u7136\uff0c\u8fd9\u4e48\u505a\u4e5f\u610f\u5473\u7740\u7f16\u8bd1\u540e\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5e76\u4e0d\u80fd\u5728 Linux \u5e73\u53f0\u4e0a\u8fd0\u884c\uff0c\u4ec5\u4ec5\u610f\u5473\u7740\u4f7f\u7528 .net6\u7f16\u8bd1\u800c\u5df2\uff0c\u4e0d\u8fc7\u8fd9\u4e2a\u5bf9\u4e8e\u8863\u670d\u81ea\u5df1\u6d17\u6765\u8bf4\u5df2\u7ecf\u8db3\u591f\u4e86\uff0c\u672c\u8eab\u9879\u76ee\u5c31\u662f\u8dd1\u5728 windows \u5e73\u53f0\u4e0a\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u7684\u9879\u76ee\u5728\u8ba1\u5212\u5207\u6362\u5230\u4f7f\u7528 .net6 \u6765\u7f16\u8bd1\uff0c\u867d\u7136\u5fae\u8f6f\u5b98\u7f51\u6709\u63d0\u4f9b\u8f6c\u6362\u5de5\u5177\uff0c\u4f46\u662f\u4f5c\u4e3a\u5f3a\u8feb\u75c7\u4eba\u7fa4\uff0c\u8fd8\u662f\u9009\u62e9\u4e86\u4ece0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[120],"class_list":["post-1104","post","type-post","status-publish","format-standard","hentry","category-daily","tag-c-sharp"],"_links":{"self":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/1104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1104"}],"version-history":[{"count":0,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=\/wp\/v2\/posts\/1104\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.5danyuan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}