{"id":34199,"date":"2025-04-29T09:13:48","date_gmt":"2025-04-29T01:13:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/34199.html"},"modified":"2025-04-29T09:13:48","modified_gmt":"2025-04-29T01:13:48","slug":"%e5%86%99windows%e6%9c%8d%e5%8a%a1%e6%97%a5%e5%bf%97-net4-5-2-%e5%ae%9a%e6%97%b6%e4%bf%ae%e6%94%b9%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b8%ad%e6%9f%90%e4%ba%9b%e5%8f%82%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/34199.html","title":{"rendered":"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570"},"content":{"rendered":"<h4>\u73af\u5883&#xff1a;<\/h4>\n<p>windows 11 Visual Studio 2015 .net 4.5.2 SQL Server<\/p>\n<h4>\u76ee\u7684&#xff1a;<\/h4>\n<p>\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570\u7684\u503c<\/p>\n<p>\u5b9a\u65f6\u4fee\u6539<span class=\"token number\">24<\/span>\u5c0f\u65f6\u5185&#xff0c;SQL\u6570\u636e\u5e93\u4e2d&#xff0c;\u8868JD_Reports \u5185&#xff0c;\u5982\u679c\u90e8\u95e8\u662f\u2018\u4f53\u68c0\u79d1&#039;&#xff0c;\u8bbe\u7f6e\u6253\u5370\u7c7b\u578b\u4e3a <span class=\"token number\">1<\/span><br \/>\n\u53ef\u4ee5\u6253\u5370\u3002<\/p>\n<h2>\u6b65\u9aa4&#xff1a;<\/h2>\n<h4>1\u3001\u65b0\u5efa\u9879\u76ee&#xff0c;\u521b\u5efawindows \u670d\u52a1<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011345-681027c91be06.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2\u3001\u4e0b\u8f7d\u65e5\u5fd7\u7a0b\u5e8f\u5305 NLog<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011345-681027c965852.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>3\u3001\u5728App.config\u4e2d\u914d\u7f6e\u65e5\u5fd7\u5305NLog<\/h4>\n<p><span class=\"token operator\">&lt;<\/span><span class=\"token punctuation\">?<\/span><span class=\"token class-name\">xml<\/span> version<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;1.0&#034;<\/span> encoding<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;utf-8&#034;<\/span> <span class=\"token punctuation\">?<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>configuration<span class=\"token operator\">&gt;<\/span><br \/>\n  <span class=\"token operator\">&lt;<\/span>configSections<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span><span class=\"token class-name\">section<\/span> name<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;nlog&#034;<\/span> type<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;NLog.Config.ConfigSectionHandler, NLog&#034;<\/span><span class=\"token operator\">\/<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n  <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>configSections<span class=\"token operator\">&gt;<\/span><\/p>\n<p>  <span class=\"token operator\">&lt;<\/span><span class=\"token class-name\">nlog<\/span> xmlns<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;http:\/\/www.nlog-project.org\/schemas\/NLog.xsd&#034;<\/span> xmlns<span class=\"token punctuation\">:<\/span>xsi<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#034;<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>targets<span class=\"token operator\">&gt;<\/span><br \/>\n      <span class=\"token operator\">&lt;<\/span><span class=\"token class-name\">target<\/span> name<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;file&#034;<\/span> xsi<span class=\"token punctuation\">:<\/span>type<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;File&#034;<\/span> fileName<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;${basedir}\/Logs\/${date:format&#061;yyyy-MM-dd}\/${date:format&#061;yyyy-MM-dd}.txt&#034;<\/span> layout<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;[${date:format&#061;yyyy-MM-dd HH\\\\:mm\\\\:ss}][${level}] ${message} ${exception}&#034;<\/span><span class=\"token operator\">\/<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>targets<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span>rules<span class=\"token operator\">&gt;<\/span><br \/>\n      <span class=\"token operator\">&lt;<\/span><span class=\"token class-name\">logger<\/span> name<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;*&#034;<\/span> minlevel<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;Debug&#034;<\/span> writeTo<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;file&#034;<\/span><span class=\"token operator\">\/<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>rules<span class=\"token operator\">&gt;<\/span><br \/>\n  <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>nlog<span class=\"token operator\">&gt;<\/span><\/p>\n<p>  <span class=\"token operator\">&lt;<\/span>startup<span class=\"token operator\">&gt;<\/span><br \/>\n    <span class=\"token operator\">&lt;<\/span><span class=\"token class-name\">supportedRuntime<\/span> version<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;v4.0&#034;<\/span> sku<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;.NETFramework,Version&#061;v4.5.2&#034;<\/span> <span class=\"token operator\">\/<\/span><span class=\"token operator\">&gt;<\/span><br \/>\n  <span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>startup<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span><span class=\"token operator\">\/<\/span>configuration<span class=\"token operator\">&gt;<\/span><\/p>\n<h4>4\u3001Report_Print.cs<\/h4>\n<p><span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Collections<span class=\"token punctuation\">.<\/span>Generic<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>ComponentModel<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Data<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Diagnostics<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Linq<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>ServiceProcess<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Text<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Threading<span class=\"token punctuation\">.<\/span>Tasks<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Data<span class=\"token punctuation\">.<\/span>SqlClient<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">System<span class=\"token punctuation\">.<\/span>Timers<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">using<\/span> <span class=\"token namespace\">NLog<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5f15\u5165 NLog \u547d\u540d\u7a7a\u95f4&#xff0c;\u7528\u4e8e\u65e5\u5fd7\u8bb0\u5f55<\/span><\/p>\n<p><span class=\"token keyword\">namespace<\/span> <span class=\"token namespace\">Report_print<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">partial<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Report_Print<\/span> <span class=\"token punctuation\">:<\/span> <span class=\"token type-list\"><span class=\"token class-name\">ServiceBase<\/span><\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><\/p>\n<p>        <span class=\"token keyword\">private<\/span> <span class=\"token class-name\">Timer<\/span> _timer<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">readonly<\/span> <span class=\"token class-name\"><span class=\"token keyword\">string<\/span><\/span> _connectionString <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;Data Source&#061;.;Initial Catalog&#061;\u3010\u81ea\u5df1\u6570\u636e\u5e93\u3011;User Id&#061;sa;Password&#061;\u3010\u81ea\u5df1\u7684\u5bc6\u7801\u3011;&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u521b\u5efa\u4e00\u4e2a\u9759\u6001\u65e5\u5fd7\u8bb0\u5f55\u5668\u5b9e\u4f8b&#xff0c;\u7528\u4e8e\u5728\u670d\u52a1\u4e2d\u8bb0\u5f55\u65e5\u5fd7<\/span><br \/>\n        <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">readonly<\/span> <span class=\"token class-name\">Logger<\/span> Log <span class=\"token operator\">&#061;<\/span> LogManager<span class=\"token punctuation\">.<\/span><span class=\"token function\">GetCurrentClassLogger<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token keyword\">public<\/span> <span class=\"token function\">Report_Print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token function\">InitializeComponent<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u8bbe\u7f6e\u670d\u52a1\u6bcf5\u5206\u949f\u68c0\u67e5\u4e00\u6b21<\/span><br \/>\n            _timer <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token constructor-invocation class-name\">Timer<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">60<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ 5\u5206\u949f<\/span><br \/>\n            _timer<span class=\"token punctuation\">.<\/span>Elapsed <span class=\"token operator\">&#043;&#061;<\/span> TimerElapsed<span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">protected<\/span> <span class=\"token keyword\">override<\/span> <span class=\"token return-type class-name\"><span class=\"token keyword\">void<\/span><\/span> <span class=\"token function\">OnStart<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\"><span class=\"token keyword\">string<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><\/span> args<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u670d\u52a1\u542f\u52a8\u65f6\u8bb0\u5f55\u65e5\u5fd7<\/span><br \/>\n            Log<span class=\"token punctuation\">.<\/span><span class=\"token function\">Debug<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5f00\u59cb\u6267\u884c&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            _timer<span class=\"token punctuation\">.<\/span><span class=\"token function\">Start<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u542f\u52a8\u65f6\u7acb\u5373\u6267\u884c\u4e00\u6b21<\/span><br \/>\n            <span class=\"token function\">UpdatePrintType<\/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>        <span class=\"token keyword\">protected<\/span> <span class=\"token keyword\">override<\/span> <span class=\"token return-type class-name\"><span class=\"token keyword\">void<\/span><\/span> <span class=\"token function\">OnStop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            _timer<span class=\"token punctuation\">.<\/span><span class=\"token function\">Stop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n            <span class=\"token comment\">\/\/ \u670d\u52a1\u542f\u52a8\u65f6\u8bb0\u5f55\u65e5\u5fd7<\/span><br \/>\n            Log<span class=\"token punctuation\">.<\/span><span class=\"token function\">Debug<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u670d\u52a1\u505c\u6b62\u6267\u884c&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">private<\/span> <span class=\"token return-type class-name\"><span class=\"token keyword\">void<\/span><\/span> <span class=\"token function\">TimerElapsed<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\"><span class=\"token keyword\">object<\/span><\/span> sender<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">ElapsedEventArgs<\/span> e<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token function\">UpdatePrintType<\/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>        <span class=\"token keyword\">private<\/span> <span class=\"token return-type class-name\"><span class=\"token keyword\">void<\/span><\/span> <span class=\"token function\">UpdatePrintType<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">try<\/span><br \/>\n            <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token keyword\">using<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">SqlConnection<\/span> conn <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token constructor-invocation class-name\">SqlConnection<\/span><span class=\"token punctuation\">(<\/span>_connectionString<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                <span class=\"token punctuation\">{<\/span><br \/>\n                    conn<span class=\"token punctuation\">.<\/span><span class=\"token function\">Open<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                    <span class=\"token class-name\"><span class=\"token keyword\">string<\/span><\/span> sql <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#064;&#034;<br \/>\n                        UPDATE JD_Reports<br \/>\n                        SET PrintType &#061; 1<br \/>\n                        WHERE Depart &#061; &#039;\u4f53\u68c0\u79d1&#039;<br \/>\n                        AND CheckTime &gt;&#061; DATEADD(HOUR, -24, GETDATE())<br \/>\n                        AND (PrintType IS NULL OR PrintType !&#061; 1)&#034;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>                    <span class=\"token keyword\">using<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token class-name\">SqlCommand<\/span> cmd <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token constructor-invocation class-name\">SqlCommand<\/span><span class=\"token punctuation\">(<\/span>sql<span class=\"token punctuation\">,<\/span> conn<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n                    <span class=\"token punctuation\">{<\/span><br \/>\n                        <span class=\"token class-name\"><span class=\"token keyword\">int<\/span><\/span> rowsAffected <span class=\"token operator\">&#061;<\/span> cmd<span class=\"token punctuation\">.<\/span><span class=\"token function\">ExecuteNonQuery<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n                        Log<span class=\"token punctuation\">.<\/span><span class=\"token function\">Debug<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5199\u5165\u65e5\u5fd7\u6210\u529f: &#034;<\/span> <span class=\"token operator\">&#043;<\/span> rowsAffected<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><span class=\"token punctuation\">;<\/span><br \/>\n                        <span class=\"token comment\">\/\/ \u8fd9\u91cc\u53ef\u4ee5\u6dfb\u52a0\u65e5\u5fd7\u8bb0\u5f55\u53d7\u5f71\u54cd\u7684\u884c\u6570<\/span><br \/>\n                    <span class=\"token punctuation\">}<\/span><br \/>\n                <span class=\"token punctuation\">}<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n            <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                <span class=\"token comment\">\/\/ \u8fd9\u91cc\u5e94\u8be5\u6dfb\u52a0\u9002\u5f53\u7684\u9519\u8bef\u65e5\u5fd7\u8bb0\u5f55<\/span><br \/>\n                <span class=\"token comment\">\/\/ \u4f8b\u5982\u4f7f\u7528 EventLog \u6216\u5176\u4ed6\u65e5\u5fd7\u6846\u67b6<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>5\u3001\u5728 Report_Print.cs \u754c\u9762\u5185&#xff0c;\u53f3\u952e&#034;\u6dfb\u52a0\u5b89\u88c5\u7a0b\u5e8f&#034;<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011345-681027c9a10f1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>6\u3001\u914d\u7f6eServiceInstaller1<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011346-681027ca215f2.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>7\u3001\u914d\u7f6eserviceProcessInstaller1<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011346-681027ca5a317.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>8\u3001\u53f3\u952e&#xff0c;\u7f16\u8bd1\u7a0b\u5e8f<\/h4>\n<p>\u5b8c\u6210 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011346-681027ca903da.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>9\u3001\u5b89\u88c5\u7a0b\u5e8f<\/h4>\n<p>sc create <span class=\"token class-name\">Report_Print<\/span> binPath<span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;E:\\\\vs2015\\\\study\\\\Report_print\\\\Report_print\\\\bin\\\\Debug\\\\Report_print.exe&#034;<\/span><br \/>\nsc start Report_Print <\/p>\n<h4>9.1\u5378\u8f7d\u7a0b\u5e8f<\/h4>\n<p>sc stop Report_Print<br \/>\nsc delete Report_Print<\/p>\n<h4>10\u3001\u5b89\u88c5\u6210\u529f<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011346-681027cabea3e.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb294\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u6b65\u9aa4\uff1a1\u3001\u65b0\u5efa\u9879\u76ee\uff0c\u521b\u5efawindows \u670d\u52a14\u3001Report_Print.cs5\u3001\u5728 Report_Print.cs \u754c\u9762\u5185\uff0c\u53f3\u952e&quot;\u6dfb\u52a0\u5b89\u88c5\u7a0b\u5e8f&quot;\u5b8c\u62109.1\u5378\u8f7d\u7a0b\u5e8f10\u3001\u5b89\u88c5\u6210\u529f<\/p>\n","protected":false},"author":2,"featured_media":34192,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[895,2886,149,2885,100],"topic":[],"class_list":["post-34199","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-net","tag-c-net","tag-windows","tag-2885","tag-100"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570 - \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\/34199.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb294\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u6b65\u9aa4\uff1a1\u3001\u65b0\u5efa\u9879\u76ee\uff0c\u521b\u5efawindows \u670d\u52a14\u3001Report_Print.cs5\u3001\u5728 Report_Print.cs \u754c\u9762\u5185\uff0c\u53f3\u952e&quot;\u6dfb\u52a0\u5b89\u88c5\u7a0b\u5e8f&quot;\u5b8c\u62109.1\u5378\u8f7d\u7a0b\u5e8f10\u3001\u5b89\u88c5\u6210\u529f\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/34199.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-29T01:13:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011345-681027c91be06.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\/34199.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/34199.html\",\"name\":\"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-29T01:13:48+00:00\",\"dateModified\":\"2025-04-29T01:13:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/34199.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/34199.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/34199.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570\"}]},{\"@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":"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570 - \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\/34199.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb294\u6b21\uff0c\u70b9\u8d5e4\u6b21\uff0c\u6536\u85cf3\u6b21\u3002\u6b65\u9aa4\uff1a1\u3001\u65b0\u5efa\u9879\u76ee\uff0c\u521b\u5efawindows \u670d\u52a14\u3001Report_Print.cs5\u3001\u5728 Report_Print.cs \u754c\u9762\u5185\uff0c\u53f3\u952e&quot;\u6dfb\u52a0\u5b89\u88c5\u7a0b\u5e8f&quot;\u5b8c\u62109.1\u5378\u8f7d\u7a0b\u5e8f10\u3001\u5b89\u88c5\u6210\u529f","og_url":"https:\/\/www.wsisp.com\/helps\/34199.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-29T01:13:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250429011345-681027c91be06.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\/34199.html","url":"https:\/\/www.wsisp.com\/helps\/34199.html","name":"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-29T01:13:48+00:00","dateModified":"2025-04-29T01:13:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/34199.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/34199.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/34199.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5199windows\u670d\u52a1\u65e5\u5fd7-.net4.5.2-\u5b9a\u65f6\u4fee\u6539\u6570\u636e\u5e93\u4e2d\u67d0\u4e9b\u53c2\u6570"}]},{"@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\/34199","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=34199"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/34199\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/34192"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=34199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=34199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=34199"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=34199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}