{"id":706,"date":"2025-10-16T16:54:53","date_gmt":"2025-10-16T08:54:53","guid":{"rendered":"https:\/\/yuthk.com\/?p=706"},"modified":"2025-10-17T15:31:04","modified_gmt":"2025-10-17T07:31:04","slug":"%e6%9b%b4%e6%96%b0c%e6%a8%a1%e6%8b%9f%e9%94%ae%e7%9b%98%e6%93%8d%e4%bd%9ccmd%e4%bf%ae%e6%94%b9%e6%b3%a8%e5%86%8c%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/yuthk.com\/?p=706","title":{"rendered":"\u66f4\u65b0C#\u6a21\u62df\u952e\u76d8\u64cd\u4f5ccmd\u4fee\u6539\u6ce8\u518c\u8868"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u4e3b\u8981\u529f\u80fd<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">1.&nbsp;<strong>hosts\u6587\u4ef6\u7ba1\u7406<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u81ea\u52a8\u68c0\u6d4b\u548c\u521b\u5efa<\/strong>: \u68c0\u67e5hosts\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u65f6\u81ea\u52a8\u521b\u5efa<\/li>\n\n\n\n<li><strong>\u5907\u4efd\u673a\u5236<\/strong>: \u5907\u4efd\u73b0\u6709hosts\u6587\u4ef6\u5e76\u4fdd\u7559\u65f6\u95f4\u6233<\/li>\n\n\n\n<li><strong>\u6761\u76ee\u8fc7\u6ee4<\/strong>: \u4fdd\u7559\u975ePDC\u6761\u76ee\uff0c\u79fb\u9664\u65e7\u7684PDC\u6761\u76ee<\/li>\n\n\n\n<li><strong>\u65b0\u6761\u76ee\u6dfb\u52a0<\/strong>: \u6dfb\u52a0\u65b0\u7684PDC\u6761\u76ee&nbsp;<code>10.21.129.2 pdc.chana.com<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2.&nbsp;<strong>\u6743\u9650\u63d0\u5347\u5904\u7406<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7ba1\u7406\u5458\u6743\u9650<\/strong>: \u901a\u8fc7Ctrl+Shift+Enter\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884cCMD<\/li>\n\n\n\n<li>\u5173\u95ed<strong>UAC<\/strong>: \u901a\u8fc7\u6ce8\u518c\u8868\u4fee\u6539\u4e34\u65f6\u7981\u7528UAC<\/li>\n\n\n\n<li><strong>\u7cfb\u7edf\u76ee\u5f55\u8bbf\u95ee<\/strong>: \u901a\u8fc7\u952e\u76d8\u64cd\u4f5cHosts\u6587\u4ef6\u7cfb\u7edf\u4e0d\u4f1a\u963b\u6b62\uff0c\u6740\u6bd2\u8f6f\u4ef6\u4e00\u822c\u4e5f\u4e0d\u4f1a\u963b\u6b62\u3002\u4f46\u662fpowertoy\u548cUsbEAmHostsEditor\u5bf9hosts\u7684\u7f16\u8f91\u6740\u8f6f\u548c\u7cfb\u7edf\u4e5f\u4e0d\u4f1a\u963b\u6b62\uff0c\u4e0d\u6e05\u695a\u5177\u4f53\u5b9e\u73b0\u65b9\u6cd5\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3.&nbsp;<strong>\u7528\u6237\u754c\u9762\u63a7\u5236<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u63a7\u5236\u53f0\u7ba1\u7406<\/strong>: \u52a8\u6001\u663e\u793a\/\u9690\u85cf\u63a7\u5236\u53f0\u7a97\u53e3<\/li>\n\n\n\n<li><strong>\u7a97\u53e3\u5b9a\u4f4d<\/strong>: \u5c06CMD\u7a97\u53e3\u5b9a\u4f4d\u5230\u5c4f\u5e55\u53f3\u4e0b\u89d2<\/li>\n\n\n\n<li><strong>\u8f93\u5165\u6cd5\u63a7\u5236<\/strong>: \u5f3a\u5236\u5207\u6362\u4e3a\u82f1\u6587\u8f93\u5165\u6cd5\u907f\u514d\u7f16\u7801\u95ee\u9898<\/li>\n\n\n\n<li><strong>\u7126\u70b9\u7ba1\u7406<\/strong>: \u786e\u4fdd\u6b63\u786e\u7684\u7a97\u53e3\u83b7\u5f97\u7126\u70b9<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u6838\u5fc3\u539f\u7406<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Windows API\u96c6\u6210<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>\/\/ \u63a7\u5236\u53f0\u7ba1\u7406<\/em>\n[DllImport(\"kernel32.dll\")]\nprivate static extern bool AllocConsole();\n\n<em>\/\/ \u7a97\u53e3\u7ba1\u7406<\/em>\n[DllImport(\"user32.dll\")]\nprivate static extern bool SetForegroundWindow(IntPtr hWnd);\n\n<em>\/\/ \u7cfb\u7edf\u4fe1\u606f\u83b7\u53d6<\/em>\n[DllImport(\"user32.dll\")]\nprivate static extern int GetSystemMetrics(int nIndex);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u81ea\u52a8\u5316\u6d41\u7a0b<\/strong><\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u521d\u59cb\u5316\u9636\u6bb5<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u663e\u793a\u63a7\u5236\u53f0\u5e76\u786e\u4fdd\u7126\u70b9<\/li>\n\n\n\n<li>\u68c0\u67e5hosts\u6587\u4ef6\u72b6\u6001<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6743\u9650\u51c6\u5907\u9636\u6bb5<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u7981\u7528UAC\uff08\u7528\u6237\u8d26\u6237\u63a7\u5236\uff09<\/li>\n\n\n\n<li>\u5207\u6362\u82f1\u6587\u8f93\u5165\u6cd5<\/li>\n\n\n\n<li>\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u542f\u52a8CMD<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6587\u4ef6\u5904\u7406\u9636\u6bb5<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u5907\u4efd\u73b0\u6709\u6587\u4ef6<\/li>\n\n\n\n<li>\u8fc7\u6ee4\u4fdd\u7559\u975ePDC\u6761\u76ee<\/li>\n\n\n\n<li>\u6e05\u7a7a\u5e76\u91cd\u5efahosts\u6587\u4ef6<\/li>\n\n\n\n<li>\u6dfb\u52a0\u65b0PDC\u6761\u76ee<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6e05\u7406\u9636\u6bb5<\/strong>\n<ul class=\"wp-block-list\">\n<li>\u9a8c\u8bc1\u4fee\u6539\u7ed3\u679c<\/li>\n\n\n\n<li>\u5220\u9664\u4e34\u65f6\u6587\u4ef6<\/li>\n\n\n\n<li>\u5173\u95edCMD\u7a97\u53e3<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7a97\u53e3\u7ba1\u7406\u6d41\u7a0b<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u68c0\u67e5\u63a7\u5236\u53f0\u662f\u5426\u5b58\u5728<br>\u2193<\/li>\n\n\n\n<li>\u4e0d\u5b58\u5728\u5219\u521b\u5efa\u5e76\u521d\u59cb\u5316<br>\u2193<\/li>\n\n\n\n<li>\u663e\u793a\u63a7\u5236\u53f0\u7a97\u53e3<br>\u2193<\/li>\n\n\n\n<li>\u5f3a\u5236\u83b7\u5f97\u7126\u70b9<br>\u2193<\/li>\n\n\n\n<li>\u6267\u884c\u64cd\u4f5c\u671f\u95f4\u7ba1\u7406CMD\u7a97\u53e3<br>\u2193<\/li>\n\n\n\n<li>\u64cd\u4f5c\u5b8c\u6210\u540e\u9690\u85cf\u63a7\u5236\u53f0<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7126\u70b9\u7ba1\u7406<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>private void ForceForegroundWindow(IntPtr hWnd)\n{\n    <em>\/\/ \u901a\u8fc7\u7ebf\u7a0b\u9644\u52a0\u786e\u4fdd\u7a97\u53e3\u80fd\u591f\u83b7\u5f97\u7126\u70b9<\/em>\n    AttachThreadInput(foregroundThread, currentThread, true);\n    SetForegroundWindow(hWnd);\n    AttachThreadInput(foregroundThread, currentThread, false);\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u63a7\u5236\u53f0\u7a97\u53e3\u7ba1\u7406<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>private void ShowConsoleAndEnsureFocus()\n{\n    _consoleHandle = GetConsoleWindow();\n    if (_consoleHandle == IntPtr.Zero)\n    {\n        AllocConsole(); \/\/ \u521b\u5efa\u63a7\u5236\u53f0\n        _consoleHandle = GetConsoleWindow();\n        \/\/ \u8bbe\u7f6e\u7f16\u7801\u548c\u8f93\u51fa\u6d41\n        Console.OutputEncoding = System.Text.Encoding.UTF8;\n        \/\/ ... \u5176\u4ed6\u521d\u59cb\u5316 ...\n    }\n\n    ShowWindow(_consoleHandle, SW_SHOW); \/\/ \u663e\u793a\u7a97\u53e3\n    Console.Title = \"HOSTS\u6587\u4ef6\u7f16\u8f91\u5668\";\n    \/\/ ... \u754c\u9762\u8bbe\u7f6e ...\n    \n    \/\/ \u5173\u952e\uff1a\u786e\u4fdd\u63a7\u5236\u53f0\u83b7\u5f97\u7126\u70b9\n    ForceForegroundWindow(_consoleHandle);\n    Thread.Sleep(1500);\n}\n\nprivate void HideConsole()\n{\n    if (_consoleHandle != IntPtr.Zero)\n    {\n        ShowWindow(_consoleHandle, SW_HIDE); \/\/ \u9690\u85cf\u7a97\u53e3\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>CMD\u81ea\u52a8\u5316<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>\/\/ \u6a21\u62df\u952e\u76d8\u8f93\u5165\u6267\u884c\u547d\u4ee4<\/em>\n_inputSimulator.Keyboard.TextEntry(\"cmd\");\n_inputSimulator.Keyboard.ModifiedKeyStroke(\n    new[] { VirtualKeyCode.CONTROL, VirtualKeyCode.SHIFT },\n    VirtualKeyCode.RETURN);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>CMD\u7a97\u53e3\u5b9a\u4f4d<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>private void SetCmdWindowPosition()\n{\n    try\n    {\n        Thread.Sleep(1500);\n        IntPtr cmdWindow = GetForegroundWindow();\n        if (cmdWindow != IntPtr.Zero)\n        {\n            int screenWidth = GetSystemMetrics(SM_CXSCREEN);\n            int screenHeight = GetSystemMetrics(SM_CYSCREEN);\n\n            \/\/ \u8ba1\u7b97\u53f3\u4e0b\u89d2\u4f4d\u7f6e\n            int windowWidth = 800;\n            int windowHeight = 600;\n            int posX = screenWidth - windowWidth - 50;\n            int posY = screenHeight - windowHeight - 50;\n\n            SetWindowPos(cmdWindow, IntPtr.Zero, posX, posY, windowWidth, windowHeight, SWP_NOZORDER);\n            \n            \/\/ \u786e\u4fddCMD\u7a97\u53e3\u4fdd\u6301\u7126\u70b9\n            ForceForegroundWindow(cmdWindow);\n            Thread.Sleep(1000);\n        }\n    }\n    catch (Exception ex)\n    {\n        Console.WriteLine($\"&#91;\u8b66\u544a] \u8bbe\u7f6e\u7a97\u53e3\u4f4d\u7f6e\u5931\u8d25: {ex.Message}\");\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u7126\u70b9\u5f3a\u5236\u7ba1\u7406<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>private void ForceForegroundWindow(IntPtr hWnd)\n{\n    uint foregroundThread = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);\n    uint currentThread = (uint)AppDomain.GetCurrentThreadId();\n\n    if (foregroundThread != currentThread)\n    {\n        AttachThreadInput(foregroundThread, currentThread, true);\n        SetForegroundWindow(hWnd);\n        AttachThreadInput(foregroundThread, currentThread, false);\n    }\n    else\n    {\n        SetForegroundWindow(hWnd);\n    }\n    Thread.Sleep(800); \/\/ \u7b49\u5f85\u7126\u70b9\u7a33\u5b9a\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u6587\u4ef6\u5904\u7406\u7b56\u7565<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528\u4e34\u65f6\u6587\u4ef6\u5b58\u50a8\u975ePDC\u6761\u76ee<\/li>\n\n\n\n<li>\u901a\u8fc7CMD\u547d\u4ee4\u64cd\u4f5c\u907f\u514d\u6743\u9650\u95ee\u9898<\/li>\n\n\n\n<li>\u4f7f\u7528PowerShell\u786e\u4fdd\u4e2d\u6587\u8def\u5f84\u652f\u6301<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u5728\u6309\u94ae\u4e2d\u4f7f\u7528<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \nusing HostsFileEditor;\n\/\/ \u6309\u94ae\u4e8b\u4ef6\nHostsEditor editor = new HostsEditor();\neditor.EditHostsFile();<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6e90\u7801<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\nusing System.Threading;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing WindowsInput;\nusing WindowsInput.Native;\nusing Microsoft.Win32;\n\nnamespace HostsFileEditor\n{\n    public class HostsEditor\n    {\n        \/\/ Windows API \u5bfc\u5165\n        &#91;DllImport(\"kernel32.dll\")]\n        private static extern bool AllocConsole();\n\n        &#91;DllImport(\"kernel32.dll\")]\n        private static extern bool FreeConsole();\n\n        &#91;DllImport(\"kernel32.dll\")]\n        private static extern IntPtr GetConsoleWindow();\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern IntPtr GetForegroundWindow();\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern bool SetForegroundWindow(IntPtr hWnd);\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern int GetSystemMetrics(int nIndex);\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern uint GetWindowThreadProcessId(IntPtr hWnd, IntPtr ProcessId);\n\n        &#91;DllImport(\"user32.dll\")]\n        private static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);\n\n        private const int SW_HIDE = 0;\n        private const int SW_SHOW = 5;\n        private const int SWP_NOSIZE = 0x0001;\n        private const int SWP_NOZORDER = 0x0004;\n        private const int SM_CXSCREEN = 0;\n        private const int SM_CYSCREEN = 1;\n\n        private readonly InputSimulator _inputSimulator;\n        private readonly string _hostsFilePath;\n        private readonly string _hostsDirectory;\n        private readonly string _tempFilePath;\n        private readonly List&lt;string&gt; _operationLog;\n        private IntPtr _consoleHandle;\n\n        public HostsEditor()\n        {\n            _inputSimulator = new InputSimulator();\n            _hostsFilePath = @\"C:\\Windows\\System32\\drivers\\etc\\hosts\";\n            _hostsDirectory = @\"C:\\Windows\\System32\\drivers\\etc\";\n            _tempFilePath = @\"C:\\Windows\\System32\\drivers\\etc\\hosts_backup.txt\";\n            _operationLog = new List&lt;string&gt;();\n        }\n\n        public void EditHostsFile()\n        {\n            try\n            {\n                \/\/ \u663e\u793a\u63a7\u5236\u53f0\u5e76\u786e\u4fdd\u83b7\u5f97\u7126\u70b9\n                ShowConsoleAndEnsureFocus();\n\n                Console.WriteLine(\"&#91;\u4fe1\u606f] \u5f00\u59cb\u5904\u7406hosts\u6587\u4ef6...\");\n\n                \/\/ \u7b2c\u4e00\u6b65\uff1a\u68c0\u67e5\u5e76\u521b\u5efahosts\u6587\u4ef6\uff08\u5982\u679c\u9700\u8981\uff09\n                bool fileExisted = CheckAndCreateHostsFile();\n\n                \/\/ \u5982\u679c\u6587\u4ef6\u539f\u672c\u5c31\u5b58\u5728\uff0c\u624d\u9700\u8981\u540e\u7eed\u7684\u7f16\u8f91\u6b65\u9aa4\n                if (fileExisted)\n                {\n                    Console.WriteLine(\"&#91;\u4fe1\u606f] \u68c0\u6d4b\u5230\u73b0\u6709hosts\u6587\u4ef6\uff0c\u6267\u884c\u7f16\u8f91\u6d41\u7a0b...\");\n                    DisableUAC();\n                    ForceEnglishInputMethod();\n\n                    \/\/ \u5907\u4efd\u73b0\u6709hosts\u6587\u4ef6\n                    BackupHostsFile();\n\n                    List&lt;string&gt; nonPdcEntries = ReadAndBackupNonPdcEntries();\n                    OpenCmdAndEditHosts(nonPdcEntries);\n                }\n                else\n                {\n                    Console.WriteLine(\"&#91;\u4fe1\u606f] \u5df2\u521b\u5efa\u65b0\u7684hosts\u6587\u4ef6\uff0c\u5305\u542bPDC\u6761\u76ee\uff0c\u65e0\u9700\u540e\u7eed\u7f16\u8f91\");\n                    _operationLog.Add(\"\u5df2\u521b\u5efa\u65b0\u7684hosts\u6587\u4ef6\u5e76\u6dfb\u52a0PDC\u6761\u76ee\");\n                }\n\n                \/\/ \u8f93\u51fa\u8be6\u7ec6\u64cd\u4f5c\u7ed3\u679c\n                Console.WriteLine(\"\\n=== \u64cd\u4f5c\u5b8c\u6210 ===\");\n                foreach (var log in _operationLog)\n                {\n                    Console.WriteLine($\"&#91;\u6210\u529f] {log}\");\n                }\n\n                \/\/ \u5b8c\u6210\u540e\u7b49\u5f85\u7528\u6237\u6309\u952e\u518d\u5173\u95ed\u63a7\u5236\u53f0\n                Console.WriteLine(\"\\n\u6309\u4efb\u610f\u952e\u5173\u95ed\u63a7\u5236\u53f0...\");\n                Console.ReadKey();\n                HideConsole();\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"\\n&#91;\u5931\u8d25] \u64cd\u4f5c\u5931\u8d25: {ex.Message}\");\n                Console.WriteLine(\"\u6309\u4efb\u610f\u952e\u5173\u95ed\u63a7\u5236\u53f0...\");\n                Console.ReadKey();\n                HideConsole();\n                throw;\n            }\n        }\n\n        private void ShowConsoleAndEnsureFocus()\n        {\n            _consoleHandle = GetConsoleWindow();\n            if (_consoleHandle == IntPtr.Zero)\n            {\n                AllocConsole();\n                _consoleHandle = GetConsoleWindow();\n                \/\/ \u8bbe\u7f6e\u63a7\u5236\u53f0\u7f16\u7801\u4e3aUTF-8\n                Console.OutputEncoding = System.Text.Encoding.UTF8;\n                Console.InputEncoding = System.Text.Encoding.UTF8;\n                \/\/ \u91cd\u5b9a\u5411\u6807\u51c6\u8f93\u51fa\u5230\u63a7\u5236\u53f0\n                var standardOutput = new StreamWriter(Console.OpenStandardOutput());\n                standardOutput.AutoFlush = true;\n                Console.SetOut(standardOutput);\n\n                \/\/ \u91cd\u5b9a\u5411\u6807\u51c6\u9519\u8bef\u5230\u63a7\u5236\u53f0\n                var standardError = new StreamWriter(Console.OpenStandardError());\n                standardError.AutoFlush = true;\n                Console.SetError(standardError);\n            }\n\n            ShowWindow(_consoleHandle, SW_SHOW);\n            Console.Title = \"HOSTS\u6587\u4ef6\u7f16\u8f91\u5668\";\n            Console.ForegroundColor = ConsoleColor.White;\n            Console.BackgroundColor = ConsoleColor.Black;\n            Console.Clear();\n\n            \/\/ \u5173\u952e\u4fee\u590d\uff1a\u786e\u4fdd\u63a7\u5236\u53f0\u83b7\u5f97\u7126\u70b9\n            ForceForegroundWindow(_consoleHandle);\n\n            \/\/ \u7b49\u5f85\u63a7\u5236\u53f0\u5b8c\u5168\u6fc0\u6d3b\n            Thread.Sleep(1500);\n\n            \/\/ \u7acb\u5373\u8f93\u51fa\u6d4b\u8bd5\u4fe1\u606f\n            Console.WriteLine(\"=== HOSTS\u6587\u4ef6\u7f16\u8f91\u5668\u63a7\u5236\u53f0 ===\");\n            Console.WriteLine(\"\u63a7\u5236\u53f0\u521d\u59cb\u5316\u5b8c\u6210\uff0c\u5f00\u59cb\u6267\u884c...\\n\");\n        }\n\n        private void HideConsole()\n        {\n            if (_consoleHandle != IntPtr.Zero)\n            {\n                ShowWindow(_consoleHandle, SW_HIDE);\n            }\n        }\n\n        \/\/ \u4fee\u590d\uff1a\u4f7f\u7528 .NET \u5185\u7f6e\u7684 GetCurrentThreadId\n        private void ForceForegroundWindow(IntPtr hWnd)\n        {\n            uint foregroundThread = GetWindowThreadProcessId(GetForegroundWindow(), IntPtr.Zero);\n            uint currentThread = (uint)AppDomain.GetCurrentThreadId(); \/\/ \u4f7f\u7528 .NET \u5185\u7f6e\u65b9\u6cd5\n\n            if (foregroundThread != currentThread)\n            {\n                AttachThreadInput(foregroundThread, currentThread, true);\n                SetForegroundWindow(hWnd);\n                AttachThreadInput(foregroundThread, currentThread, false);\n            }\n            else\n            {\n                SetForegroundWindow(hWnd);\n            }\n\n            \/\/ \u989d\u5916\u7b49\u5f85\u786e\u4fdd\u7126\u70b9\u7a33\u5b9a\n            Thread.Sleep(800);\n        }\n\n        private bool CheckAndCreateHostsFile()\n        {\n            try\n            {\n                if (File.Exists(_hostsFilePath))\n                {\n                    Console.WriteLine(\"&#91;\u4fe1\u606f] \u68c0\u6d4b\u5230hosts\u6587\u4ef6\uff0c\u7ee7\u7eed\u6267\u884c\u7f16\u8f91\u6d41\u7a0b...\");\n                    return true;\n                }\n\n                Console.WriteLine(\"&#91;\u4fe1\u606f] hosts\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u5c06\u901a\u8fc7CMD\u65b9\u5f0f\u521b\u5efa...\");\n                bool created = CreateHostsFileViaCmd();\n\n                if (created)\n                {\n                    Console.WriteLine(\"&#91;\u6210\u529f] hosts\u6587\u4ef6\u521b\u5efa\u5b8c\u6210\uff0c\u5305\u542bPDC\u6761\u76ee\");\n                    return false;\n                }\n                else\n                {\n                    throw new Exception(\"hosts\u6587\u4ef6\u521b\u5efa\u5931\u8d25\");\n                }\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] \u68c0\u67e5hosts\u6587\u4ef6\u5931\u8d25: {ex.Message}\");\n                throw;\n            }\n        }\n\n        private bool CreateHostsFileViaCmd()\n        {\n            try\n            {\n                Console.WriteLine(\"&#91;\u6267\u884c] \u6b63\u5728\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00CMD\u521b\u5efahosts\u6587\u4ef6...\");\n                Thread.Sleep(1500); \/\/ \u589e\u52a0\u7b49\u5f85\u65f6\u95f4\n\n                \/\/ \u786e\u4fdd\u63a7\u5236\u53f0\u7126\u70b9\n                ForceForegroundWindow(_consoleHandle);\n                Thread.Sleep(800);\n\n                \/\/ \u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00CMD\n                _inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_R);\n                Thread.Sleep(500); \/\/ \u589e\u52a0\u7b49\u5f85\u65f6\u95f4\n\n                _inputSimulator.Keyboard.TextEntry(\"cmd\");\n                Thread.Sleep(500);\n\n                _inputSimulator.Keyboard.ModifiedKeyStroke(\n                    new&#91;] { VirtualKeyCode.CONTROL, VirtualKeyCode.SHIFT },\n                    VirtualKeyCode.RETURN);\n\n                Thread.Sleep(2000); \/\/ \u91cd\u8981\uff1a\u7b49\u5f85UAC\u5bf9\u8bdd\u6846\u548c\u5904\u7406\n\n                \/\/ \u8bbe\u7f6eCMD\u7a97\u53e3\u4f4d\u7f6e\u5230\u53f3\u4e0b\u89d2\n                SetCmdWindowPosition();\n\n                \/\/ \u7b49\u5f85CMD\u7a97\u53e3\u5b8c\u5168\u6fc0\u6d3b\n                Thread.Sleep(1500);\n\n                Console.WriteLine(\"&#91;\u4fe1\u606f] CMD\u5df2\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00\uff0c\u5f00\u59cb\u521b\u5efahosts\u6587\u4ef6...\");\n\n                \/\/ \u5207\u6362\u5230hosts\u76ee\u5f55\n                _inputSimulator.Keyboard.TextEntry($\"cd \/d \\\"{_hostsDirectory}\\\"\");\n                _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n                Thread.Sleep(1500);\n\n                \/\/ \u4f7f\u7528chcp\u547d\u4ee4\u8bbe\u7f6e\u63a7\u5236\u53f0\u7f16\u7801\u4e3aUTF-8\n                ExecuteCmdCommand(\"\u8bbe\u7f6eUTF-8\u7f16\u7801\", \"chcp 65001\");\n\n                \/\/ \u521b\u5efa\u5305\u542bPDC\u6761\u76ee\u7684hosts\u6587\u4ef6 - \u4f7f\u7528\u652f\u6301\u4e2d\u6587\u7684\u7f16\u7801\u65b9\u5f0f\n                ExecuteCmdCommand(\"\u521b\u5efahosts\u6587\u4ef6\u5934\", \"echo # Hosts\u6587\u4ef6 &gt; hosts\");\n                ExecuteCmdCommand(\"\u6dfb\u52a0\u672c\u5730\u4e3b\u673a\u6761\u76ee\", \"echo 127.0.0.1 localhost &gt;&gt; hosts\");\n                ExecuteCmdCommand(\"\u6dfb\u52a0IPv6\u672c\u5730\u4e3b\u673a\u6761\u76ee\", \"echo ::1 localhost &gt;&gt; hosts\");\n                ExecuteCmdCommand(\"\u6dfb\u52a0\u6ce8\u91ca\", \"echo # PDC\u6761\u76ee &gt;&gt; hosts\");\n                ExecuteCmdCommand(\"\u6dfb\u52a0PDC\u6761\u76ee\", \"echo 10.21.129.2 pdc.chana.com &gt;&gt; hosts\");\n                ExecuteCmdCommand(\"\u6dfb\u52a0\u7a7a\u884c\", \"echo. &gt;&gt; hosts\");\n\n                \/\/ \u9a8c\u8bc1\u6587\u4ef6\n                _inputSimulator.Keyboard.TextEntry(\"dir hosts\");\n                _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n                Thread.Sleep(1500);\n\n                _inputSimulator.Keyboard.TextEntry(\"type hosts\");\n                _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n                Thread.Sleep(1500);\n\n                \/\/ \u5173\u95edCMD\n                _inputSimulator.Keyboard.TextEntry(\"exit\");\n                _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n                Thread.Sleep(1500);\n\n                return File.Exists(_hostsFilePath);\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] \u901a\u8fc7CMD\u521b\u5efa\u6587\u4ef6\u5931\u8d25: {ex.Message}\");\n                return false;\n            }\n        }\n\n        private void SetCmdWindowPosition()\n        {\n            try\n            {\n                Thread.Sleep(1500); \/\/ \u589e\u52a0\u7b49\u5f85\u65f6\u95f4\uff0c\u786e\u4fdd\u7a97\u53e3\u5b8c\u5168\u6253\u5f00\n\n                IntPtr cmdWindow = GetForegroundWindow();\n                if (cmdWindow != IntPtr.Zero)\n                {\n                    int screenWidth = GetSystemMetrics(SM_CXSCREEN);\n                    int screenHeight = GetSystemMetrics(SM_CYSCREEN);\n\n                    \/\/ \u8bbe\u7f6e\u7a97\u53e3\u5927\u5c0f\u548c\u4f4d\u7f6e\uff08\u53f3\u4e0b\u89d2\uff09\n                    int windowWidth = 800;\n                    int windowHeight = 600;\n                    int posX = screenWidth - windowWidth - 50; \/\/ \u8ddd\u79bb\u53f3\u8fb950\u50cf\u7d20\n                    int posY = screenHeight - windowHeight - 50; \/\/ \u8ddd\u79bb\u5e95\u90e850\u50cf\u7d20\n\n                    SetWindowPos(cmdWindow, IntPtr.Zero, posX, posY, windowWidth, windowHeight, SWP_NOZORDER);\n                    Console.WriteLine($\"&#91;\u4fe1\u606f] CMD\u7a97\u53e3\u5df2\u79fb\u52a8\u5230\u53f3\u4e0b\u89d2\u4f4d\u7f6e: ({posX}, {posY})\");\n\n                    \/\/ \u786e\u4fddCMD\u7a97\u53e3\u4fdd\u6301\u7126\u70b9\n                    ForceForegroundWindow(cmdWindow);\n                    Thread.Sleep(1000);\n                }\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u8b66\u544a] \u8bbe\u7f6e\u7a97\u53e3\u4f4d\u7f6e\u5931\u8d25: {ex.Message}\");\n            }\n        }\n\n        private void ExecuteCmdCommand(string stepName, string command)\n        {\n            Console.WriteLine($\"&#91;\u6267\u884c] {stepName}...\");\n\n            \/\/ \u786e\u4fddCMD\u7a97\u53e3\u6709\u7126\u70b9\n            IntPtr cmdWindow = GetForegroundWindow();\n            if (cmdWindow != _consoleHandle) \/\/ \u5982\u679c\u4e0d\u662f\u63a7\u5236\u53f0\u7a97\u53e3\uff0c\u8bf4\u660e\u662fCMD\u7a97\u53e3\n            {\n                ForceForegroundWindow(cmdWindow);\n                Thread.Sleep(500);\n            }\n\n            _inputSimulator.Keyboard.TextEntry(command);\n            _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n            Thread.Sleep(1200); \/\/ \u589e\u52a0\u7b49\u5f85\u65f6\u95f4\n        }\n\n        private void BackupHostsFile()\n        {\n            try\n            {\n                if (File.Exists(_hostsFilePath))\n                {\n                    string timestamp = DateTime.Now.ToString(\"yyyyMMdd_HHmmss\");\n                    string backupFileName = $\"hosts_{timestamp}.txt\";\n                    string backupFilePath = Path.Combine(_hostsDirectory, backupFileName);\n\n                    File.Copy(_hostsFilePath, backupFilePath, true);\n                    _operationLog.Add($\"hosts\u6587\u4ef6\u5df2\u5907\u4efd\u4e3a: {backupFileName}\");\n                    Console.WriteLine($\"&#91;\u5b8c\u6210] hosts\u6587\u4ef6\u5df2\u5907\u4efd: {backupFileName}\");\n                }\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u8b66\u544a] \u5907\u4efdhosts\u6587\u4ef6\u5931\u8d25: {ex.Message}\");\n            }\n        }\n\n        private void DisableUAC()\n        {\n            try\n            {\n                Console.WriteLine(\"&#91;\u6267\u884c] \u6b63\u5728\u5173\u95edUAC...\");\n                string registryPath = @\"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\";\n                SetUACLevel(registryPath, 0);\n                _operationLog.Add(\"UAC\u5df2\u6210\u529f\u5173\u95ed\");\n                Console.WriteLine(\"&#91;\u5b8c\u6210] UAC\u5173\u95ed\u5b8c\u6210\");\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] \u5173\u95edUAC\u5931\u8d25: {ex.Message}\");\n                throw;\n            }\n        }\n\n        private void SetUACLevel(string registryPath, int uacLevel)\n        {\n            try\n            {\n                Registry.SetValue(registryPath, \"ConsentPromptBehaviorAdmin\", uacLevel, RegistryValueKind.DWord);\n                Registry.SetValue(registryPath, \"EnableLUA\", uacLevel == 0 ? 0 : 1, RegistryValueKind.DWord);\n                Registry.SetValue(registryPath, \"PromptOnSecureDesktop\", uacLevel == 0 ? 0 : 1, RegistryValueKind.DWord);\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] \u8bbe\u7f6eUAC\u7b49\u7ea7\u5931\u8d25: {ex.Message}\");\n                throw;\n            }\n        }\n\n        private void ForceEnglishInputMethod()\n        {\n            try\n            {\n                Console.WriteLine(\"&#91;\u6267\u884c] \u6b63\u5728\u5207\u6362\u8f93\u5165\u6cd5\u4e3a\u82f1\u6587\u6a21\u5f0f...\");\n                Thread.CurrentThread.CurrentCulture = new CultureInfo(\"en-US\");\n                Thread.CurrentThread.CurrentUICulture = new CultureInfo(\"en-US\");\n                SwitchToEnglishInputMethod();\n                Thread.Sleep(800);\n                _operationLog.Add(\"\u8f93\u5165\u6cd5\u5df2\u5207\u6362\u4e3a\u82f1\u6587\u6a21\u5f0f\");\n                Console.WriteLine(\"&#91;\u5b8c\u6210] \u8f93\u5165\u6cd5\u5207\u6362\u5b8c\u6210\");\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u8b66\u544a] \u8f93\u5165\u6cd5\u5207\u6362\u8b66\u544a: {ex.Message}\");\n            }\n        }\n\n        private void SwitchToEnglishInputMethod()\n        {\n            try\n            {\n                _inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.SPACE);\n                Thread.Sleep(800);\n                _inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.SPACE);\n                Thread.Sleep(800);\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] \u8f93\u5165\u6cd5\u5207\u6362\u5931\u8d25: {ex.Message}\");\n            }\n        }\n\n        private List&lt;string&gt; ReadAndBackupNonPdcEntries()\n        {\n            var nonPdcEntries = new List&lt;string&gt;();\n\n            try\n            {\n                Console.WriteLine(\"&#91;\u6267\u884c] \u6b63\u5728\u8bfb\u53d6\u548c\u5907\u4efdhosts\u6587\u4ef6...\");\n\n                string&#91;] allLines = File.ReadAllLines(_hostsFilePath);\n                int pdcCount = 0;\n                int validEntriesCount = 0;\n\n                foreach (string line in allLines)\n                {\n                    string trimmedLine = line.Trim();\n\n                    if (!string.IsNullOrWhiteSpace(trimmedLine) &amp;&amp;\n                        !trimmedLine.Contains(\"pdc.chana.com\"))\n                    {\n                        nonPdcEntries.Add(line);\n                        validEntriesCount++;\n                    }\n                    else if (trimmedLine.Contains(\"pdc.chana.com\") &amp;&amp; !trimmedLine.StartsWith(\"#\"))\n                    {\n                        pdcCount++;\n                    }\n                }\n\n                if (nonPdcEntries.Count &gt; 0)\n                {\n                    File.WriteAllLines(_tempFilePath, nonPdcEntries);\n                    Console.WriteLine($\"&#91;\u4fe1\u606f] \u5df2\u521b\u5efa\u4e34\u65f6\u5907\u4efd\u6587\u4ef6: {_tempFilePath}\");\n                }\n\n                Console.WriteLine($\"&#91;\u4fe1\u606f] \u8fc7\u6ee4 {pdcCount} \u4e2aPDC\u6761\u76ee\uff0c\u4fdd\u7559 {nonPdcEntries.Count} \u4e2a\u6709\u6548\u6761\u76ee\");\n                _operationLog.Add($\"\u5df2\u5907\u4efd {validEntriesCount} \u4e2a\u975ePDC\u6761\u76ee\uff0c\u79fb\u9664 {pdcCount} \u4e2a\u65e7PDC\u6761\u76ee\");\n                Console.WriteLine(\"&#91;\u5b8c\u6210] \u6587\u4ef6\u8bfb\u53d6\u5907\u4efd\u5b8c\u6210\");\n\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] \u8bfb\u53d6\u548c\u5907\u4efdhosts\u6587\u4ef6\u5931\u8d25: {ex.Message}\");\n                throw;\n            }\n\n            return nonPdcEntries;\n        }\n\n        private void OpenCmdAndEditHosts(List&lt;string&gt; nonPdcEntries)\n        {\n            try\n            {\n                Console.WriteLine(\"\\n&#91;\u6267\u884c] \u6b63\u5728\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00CMD\u8fdb\u884c\u7f16\u8f91...\");\n\n                \/\/ \u786e\u4fdd\u63a7\u5236\u53f0\u6709\u7126\u70b9\n                ForceForegroundWindow(_consoleHandle);\n                Thread.Sleep(1000);\n\n                _inputSimulator.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.VK_R);\n                Thread.Sleep(800);\n\n                _inputSimulator.Keyboard.TextEntry(\"cmd\");\n                Thread.Sleep(800);\n\n                _inputSimulator.Keyboard.ModifiedKeyStroke(\n                    new&#91;] { VirtualKeyCode.CONTROL, VirtualKeyCode.SHIFT },\n                    VirtualKeyCode.RETURN);\n\n                Thread.Sleep(2500); \/\/ \u91cd\u8981\uff1a\u7b49\u5f85UAC\u5bf9\u8bdd\u6846\n\n                \/\/ \u8bbe\u7f6eCMD\u7a97\u53e3\u4f4d\u7f6e\u5230\u53f3\u4e0b\u89d2\n                SetCmdWindowPosition();\n\n                _operationLog.Add(\"\u5df2\u4ee5\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00CMD\");\n                Console.WriteLine(\"&#91;\u5b8c\u6210] CMD\u5df2\u6253\u5f00\");\n\n                \/\/ \u6267\u884c\u5404\u4e2a\u6b65\u9aa4\u5e76\u5b9e\u65f6\u53cd\u9988\n                ExecuteCmdStep(\"\u6e05\u7a7ahosts\u6587\u4ef6\", () =&gt; ClearHostsFile());\n\n                if (nonPdcEntries.Count &gt; 0)\n                {\n                    ExecuteCmdStep(\"\u6062\u590d\u975ePDC\u6761\u76ee\", () =&gt; RestoreNonPdcEntries());\n                }\n\n                ExecuteCmdStep(\"\u6dfb\u52a0\u65b0PDC\u6761\u76ee\", () =&gt; AddNewPdcEntry());\n                ExecuteCmdStep(\"\u9a8c\u8bc1\u4fee\u6539\u7ed3\u679c\", () =&gt; VerifyFinalResult());\n                ExecuteCmdStep(\"\u6e05\u7406\u4e34\u65f6\u6587\u4ef6\", () =&gt; CleanupTempFile());\n\n                Thread.Sleep(1500);\n                _inputSimulator.Keyboard.TextEntry(\"exit\");\n                _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n                _operationLog.Add(\"CMD\u7a97\u53e3\u5df2\u5173\u95ed\");\n                Console.WriteLine(\"&#91;\u5b8c\u6210] CMD\u64cd\u4f5c\u5b8c\u6210\");\n\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u9519\u8bef] CMD\u64cd\u4f5c\u5931\u8d25: {ex.Message}\");\n                throw;\n            }\n        }\n\n        private void ExecuteCmdStep(string stepName, Action action)\n        {\n            Console.WriteLine($\"&#91;\u6267\u884c] {stepName}...\");\n\n            \/\/ \u786e\u4fddCMD\u7a97\u53e3\u6709\u7126\u70b9\n            IntPtr cmdWindow = GetForegroundWindow();\n            if (cmdWindow != _consoleHandle)\n            {\n                ForceForegroundWindow(cmdWindow);\n                Thread.Sleep(800);\n            }\n\n            action();\n            Thread.Sleep(1500);\n            Console.WriteLine($\"&#91;\u5b8c\u6210] {stepName}\");\n        }\n\n        private void ClearHostsFile()\n        {\n            _inputSimulator.Keyboard.TextEntry($\"echo. &gt; \\\"{_hostsFilePath}\\\"\");\n            _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n            Thread.Sleep(1500);\n            _operationLog.Add(\"hosts\u6587\u4ef6\u5df2\u6e05\u7a7a\");\n        }\n\n        private void RestoreNonPdcEntries()\n        {\n            _inputSimulator.Keyboard.TextEntry($\"type \\\"{_tempFilePath}\\\" &gt;&gt; \\\"{_hostsFilePath}\\\"\");\n            _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n            Thread.Sleep(2500);\n            _operationLog.Add(\"\u975ePDC\u6761\u76ee\u5df2\u6062\u590d\");\n        }\n\n        private void AddNewPdcEntry()\n        {\n            Thread.Sleep(1500);\n            _inputSimulator.Keyboard.TextEntry($\"echo. &gt;&gt; \\\"{_hostsFilePath}\\\"\");\n            _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n            Thread.Sleep(1500);\n\n            string psCommand = $\"Add-Content -Path '{_hostsFilePath}' -Value '10.21.129.2   pdc.chana.com'\";\n            _inputSimulator.Keyboard.TextEntry($\"powershell -Command \\\"{psCommand}\\\"\");\n            _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n            Thread.Sleep(2000);\n            _operationLog.Add(\"\u65b0PDC\u6761\u76ee\u5df2\u6dfb\u52a0: 10.21.129.2 pdc.chana.com\");\n        }\n\n        private void VerifyFinalResult()\n        {\n            _inputSimulator.Keyboard.TextEntry($\"type \\\"{_hostsFilePath}\\\" | findstr \\\"pdc.chana.com\\\"\");\n            _inputSimulator.Keyboard.KeyPress(VirtualKeyCode.RETURN);\n            Thread.Sleep(1500);\n            _operationLog.Add(\"hosts\u6587\u4ef6\u4fee\u6539\u5df2\u9a8c\u8bc1\");\n        }\n\n        private void CleanupTempFile()\n        {\n            try\n            {\n                if (File.Exists(_tempFilePath))\n                {\n                    File.Delete(_tempFilePath);\n                    _operationLog.Add(\"\u4e34\u65f6\u5907\u4efd\u6587\u4ef6\u5df2\u6e05\u7406\");\n                }\n            }\n            catch (Exception ex)\n            {\n                Console.WriteLine($\"&#91;\u8b66\u544a] \u6e05\u7406\u4e34\u65f6\u6587\u4ef6\u5931\u8d25: {ex.Message}\");\n            }\n        }\n    }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3b\u8981\u529f\u80fd 1.&nbsp;hosts\u6587\u4ef6\u7ba1\u7406 2.&nbsp;\u6743\u9650\u63d0\u5347\u5904\u7406 3.&nbsp;\u7528\u6237\u754c\u9762\u63a7\u5236 \u6838\u5fc3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,25,31],"tags":[],"class_list":["post-706","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-31"],"_links":{"self":[{"href":"https:\/\/yuthk.com\/index.php?rest_route=\/wp\/v2\/posts\/706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yuthk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yuthk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yuthk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yuthk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=706"}],"version-history":[{"count":11,"href":"https:\/\/yuthk.com\/index.php?rest_route=\/wp\/v2\/posts\/706\/revisions"}],"predecessor-version":[{"id":723,"href":"https:\/\/yuthk.com\/index.php?rest_route=\/wp\/v2\/posts\/706\/revisions\/723"}],"wp:attachment":[{"href":"https:\/\/yuthk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yuthk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yuthk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}