2019-08-25 21:46:42 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2019-08-31 22:04:15 +08:00
|
|
|
|
using System.Security.Cryptography;
|
2019-08-25 21:46:42 +08:00
|
|
|
|
using System.Security.Principal;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Threading;
|
2019-08-31 22:04:15 +08:00
|
|
|
|
using Microsoft.Win32;
|
2019-08-25 21:46:42 +08:00
|
|
|
|
|
|
|
|
|
internal static class Win32API
|
|
|
|
|
{
|
|
|
|
|
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
|
|
|
internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace setup
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
2019-08-31 22:04:15 +08:00
|
|
|
|
static double systemVersion = Convert.ToDouble(Environment.OSVersion.Version.Major + "." + Environment.OSVersion.Version.Minor);
|
2019-08-25 21:46:42 +08:00
|
|
|
|
public static bool IsAdministrator()
|
|
|
|
|
{
|
|
|
|
|
WindowsIdentity current = WindowsIdentity.GetCurrent();
|
|
|
|
|
WindowsPrincipal windowsPrincipal = new WindowsPrincipal(current);
|
|
|
|
|
//WindowsBuiltInRole可以枚举出很多权限,例如系统用户、User、Guest等等
|
|
|
|
|
return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool IsWin64(Process process)
|
|
|
|
|
{
|
|
|
|
|
IntPtr processHandle;
|
|
|
|
|
bool retVal;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
processHandle = Process.GetProcessById(process.Id).Handle;
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return Win32API.IsWow64Process(processHandle, out retVal) && retVal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetDownloadURL()
|
|
|
|
|
{
|
|
|
|
|
Process cur = Process.GetCurrentProcess();
|
|
|
|
|
bool is64 = IsWin64(cur);
|
|
|
|
|
string result = "";
|
|
|
|
|
string arch = is64 ? "amd64" : "386";
|
2019-09-01 01:44:55 +08:00
|
|
|
|
string schema = "https://";
|
|
|
|
|
if (systemVersion < 6.3) schema = "http://";
|
|
|
|
|
string url = schema + "server-0.sercretcore.cn/api/download?arch=" + arch + "&platform=windows";
|
|
|
|
|
|
2019-08-30 16:48:34 +08:00
|
|
|
|
Stream stream;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
|
|
|
|
|
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
|
|
|
|
|
stream = resp.GetResponseStream();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(ex.ToString());
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-25 21:46:42 +08:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//获取内容
|
|
|
|
|
using (StreamReader reader = new StreamReader(stream))
|
|
|
|
|
{
|
|
|
|
|
result = reader.ReadToEnd();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
stream.Close();
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Mkdir(string subPath)
|
|
|
|
|
{
|
|
|
|
|
if (!Directory.Exists(subPath))
|
|
|
|
|
{
|
|
|
|
|
//创建pic文件夹
|
|
|
|
|
Directory.CreateDirectory(subPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static string runCmd(string sr)
|
|
|
|
|
{
|
|
|
|
|
Process pro = null;
|
|
|
|
|
string ll = string.Empty;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
pro = new Process();
|
|
|
|
|
pro.StartInfo.FileName = "cmd.exe"; //cmd
|
|
|
|
|
pro.StartInfo.UseShellExecute = false; //不显示shell
|
|
|
|
|
pro.StartInfo.CreateNoWindow = true; //不创建窗口
|
|
|
|
|
pro.StartInfo.RedirectStandardInput = true; //打开流输入
|
|
|
|
|
pro.StartInfo.RedirectStandardOutput = true; //打开流输出
|
|
|
|
|
pro.StartInfo.RedirectStandardError = true; //打开错误流
|
|
|
|
|
pro.Start();//执行
|
|
|
|
|
pro.StandardInput.WriteLine(sr);
|
|
|
|
|
pro.StandardInput.WriteLine("exit"); //&exit运行完立即退出
|
|
|
|
|
pro.StandardInput.AutoFlush = true; //清缓存
|
|
|
|
|
|
|
|
|
|
ll = pro.StandardOutput.ReadToEnd() + pro.StandardError.ReadToEnd(); //读取输出
|
|
|
|
|
|
2019-09-02 19:16:12 +08:00
|
|
|
|
pro.WaitForExit(); //等待程序执行完退出进程
|
|
|
|
|
pro.Close();//结束
|
2019-08-25 21:46:42 +08:00
|
|
|
|
return ll;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Exception Occurred:{ 0},{ 1}", ex.Message, ex.StackTrace.ToString());
|
|
|
|
|
return ex.Message.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 执行外部命令
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="argument">命令参数</param>
|
|
|
|
|
/// <param name="application">命令程序路径</param>
|
|
|
|
|
/// <returns>执行结果</returns>
|
|
|
|
|
public static string ExecuteOutCmd(string applocaltion, string argument)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
using (var process = new Process())
|
|
|
|
|
{
|
|
|
|
|
process.StartInfo.Arguments = argument;
|
|
|
|
|
process.StartInfo.FileName = applocaltion;
|
|
|
|
|
process.StartInfo.UseShellExecute = false;
|
|
|
|
|
process.StartInfo.RedirectStandardInput = true;
|
|
|
|
|
process.StartInfo.RedirectStandardOutput = true;
|
|
|
|
|
process.StartInfo.RedirectStandardError = true;
|
|
|
|
|
process.StartInfo.CreateNoWindow = true;
|
|
|
|
|
|
|
|
|
|
process.Start();
|
|
|
|
|
process.StandardInput.AutoFlush = true;
|
|
|
|
|
process.StandardInput.WriteLine("exit");
|
|
|
|
|
|
|
|
|
|
//获取cmd窗口的输出信息
|
|
|
|
|
string output = process.StandardOutput.ReadToEnd() + process.StandardError.ReadToEnd();
|
|
|
|
|
|
|
|
|
|
process.WaitForExit();
|
|
|
|
|
process.Close();
|
|
|
|
|
|
|
|
|
|
return output;
|
|
|
|
|
}
|
2019-08-25 23:46:35 +08:00
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
2019-08-25 21:46:42 +08:00
|
|
|
|
{
|
|
|
|
|
return ex.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 下载文件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="url">下载地址</param>
|
|
|
|
|
/// <param name="filePath">保存路径</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static bool DownLoadOneFile(string url, string filePath)
|
|
|
|
|
{
|
|
|
|
|
FileStream fstream = new FileStream(filePath, FileMode.Create, FileAccess.Write);
|
|
|
|
|
WebRequest wRequest = WebRequest.Create(url);
|
2019-08-31 22:04:15 +08:00
|
|
|
|
|
2019-08-25 21:46:42 +08:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
WebResponse wResponse = wRequest.GetResponse();
|
|
|
|
|
int contentLength = (int)wResponse.ContentLength;
|
|
|
|
|
|
|
|
|
|
byte[] buffer = new byte[1024];
|
|
|
|
|
|
|
|
|
|
///备注:Properties.Settings.Default.byte_size是从配置文件中读取的
|
|
|
|
|
int read_count = 0;
|
|
|
|
|
int total_read_count = 0;
|
|
|
|
|
bool complete = false;
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Downloading....");
|
|
|
|
|
|
|
|
|
|
while (!complete)
|
|
|
|
|
{
|
|
|
|
|
read_count = wResponse.GetResponseStream().Read(buffer, 0, buffer.Length);
|
|
|
|
|
if (read_count > 0)
|
|
|
|
|
{
|
|
|
|
|
fstream.Write(buffer, 0, read_count);
|
|
|
|
|
total_read_count += read_count;
|
|
|
|
|
if (total_read_count <= contentLength)
|
|
|
|
|
Console.Write(".");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
complete = true;
|
|
|
|
|
Console.WriteLine("");
|
|
|
|
|
Console.WriteLine("Download finished, installing...");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fstream.Flush();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
throw ex;
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
fstream.Close();
|
|
|
|
|
wRequest = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///直接删除指定目录下的所有文件及文件夹(保留目录)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="strPath">文件夹路径</param>
|
|
|
|
|
/// <returns>执行结果</returns>
|
|
|
|
|
public static void DeleteDir(string file)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//去除文件夹和子文件的只读属性
|
|
|
|
|
//去除文件夹的只读属性
|
|
|
|
|
DirectoryInfo fileInfo = new DirectoryInfo(file);
|
|
|
|
|
fileInfo.Attributes = FileAttributes.Normal & FileAttributes.Directory;
|
|
|
|
|
|
|
|
|
|
//去除文件的只读属性
|
|
|
|
|
File.SetAttributes(file, FileAttributes.Normal);
|
|
|
|
|
|
|
|
|
|
//判断文件夹是否还存在
|
|
|
|
|
if (Directory.Exists(file))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
foreach (string f in Directory.GetFileSystemEntries(file))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (File.Exists(f))
|
|
|
|
|
{
|
|
|
|
|
//如果有子文件删除文件
|
|
|
|
|
File.Delete(f);
|
|
|
|
|
Console.WriteLine(f);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//循环递归删除子文件夹
|
|
|
|
|
DeleteDir(f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//删除空文件夹
|
|
|
|
|
|
|
|
|
|
Directory.Delete(file);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2019-08-30 16:48:34 +08:00
|
|
|
|
catch (Exception) // 异常处理
|
2019-08-25 21:46:42 +08:00
|
|
|
|
{
|
2019-08-25 23:30:03 +08:00
|
|
|
|
// Console.WriteLine(ex.Message.ToString());// 异常信息
|
2019-08-25 21:46:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-31 22:04:15 +08:00
|
|
|
|
public static string GetChecksum(string file)
|
2019-08-25 21:46:42 +08:00
|
|
|
|
{
|
2019-08-31 22:04:15 +08:00
|
|
|
|
using (FileStream stream = File.OpenRead(file))
|
2019-08-25 21:46:42 +08:00
|
|
|
|
{
|
2019-08-31 22:04:15 +08:00
|
|
|
|
var sha = new SHA256Managed();
|
|
|
|
|
byte[] checksum = sha.ComputeHash(stream);
|
|
|
|
|
return BitConverter.ToString(checksum).Replace("-", string.Empty).ToLower();
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-30 16:48:34 +08:00
|
|
|
|
|
2019-08-31 22:04:15 +08:00
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2019-09-01 01:44:55 +08:00
|
|
|
|
if (systemVersion < 5.1)
|
2019-08-31 22:04:15 +08:00
|
|
|
|
{
|
2019-09-01 01:44:55 +08:00
|
|
|
|
Console.WriteLine("Minimum system support for Windows XP.");
|
2019-08-31 22:04:15 +08:00
|
|
|
|
Console.ReadLine();
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
}
|
2019-08-30 16:48:34 +08:00
|
|
|
|
|
2019-08-31 22:04:15 +08:00
|
|
|
|
if (IsAdministrator())
|
|
|
|
|
{
|
2019-08-25 21:46:42 +08:00
|
|
|
|
Console.Write(@"
|
|
|
|
|
DC-Agent
|
|
|
|
|
|
|
|
|
|
https://github.com/yi-ge/dc-agent
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
MIT License
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2019 Yige
|
|
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
of this software and associated documentation files (the " + "\"Software\")" + @", to deal
|
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED " + "\"AS IS\"" + @", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
|
SOFTWARE.");
|
|
|
|
|
Console.WriteLine("");
|
|
|
|
|
Console.WriteLine("");
|
2019-08-25 23:46:35 +08:00
|
|
|
|
|
2019-08-30 16:48:34 +08:00
|
|
|
|
string cmd;
|
2019-08-25 23:46:35 +08:00
|
|
|
|
|
|
|
|
|
if (args.Length > 0 && (args[0] == "--install" || args[0] == "/install"))
|
|
|
|
|
{
|
|
|
|
|
cmd = "1";
|
|
|
|
|
}
|
|
|
|
|
else if (args.Length > 0 && (args[0] == "--uninstall" || args[0] == "/uninstall"))
|
|
|
|
|
{
|
|
|
|
|
cmd = "2";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("What do you want to do?");
|
2019-09-02 19:16:12 +08:00
|
|
|
|
Console.WriteLine("1) Install (I accept the MIT License)");
|
|
|
|
|
Console.WriteLine("2) Uninstall(Will exit the Node.js process)");
|
2019-08-25 23:46:35 +08:00
|
|
|
|
Console.WriteLine("3) Exit");
|
|
|
|
|
Console.Write("#?");
|
|
|
|
|
cmd = Console.ReadLine();
|
|
|
|
|
}
|
2019-08-25 21:46:42 +08:00
|
|
|
|
|
|
|
|
|
if (cmd == "1")
|
|
|
|
|
{
|
|
|
|
|
string res = GetDownloadURL();
|
2019-08-30 16:48:34 +08:00
|
|
|
|
if (res == "")
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Server connection failed, please check your network connection and try again.");
|
|
|
|
|
Console.ReadLine();
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-25 21:46:42 +08:00
|
|
|
|
string patternStatus = "\"status\":.";
|
|
|
|
|
string patternDownloadURL = "\"downloadURL\":\".*?[^\\\\]\",";
|
2019-08-31 22:04:15 +08:00
|
|
|
|
string patternSha256 = "\"sha256\":\".*?[^\\\\]\",";
|
2019-08-25 21:46:42 +08:00
|
|
|
|
string status = Regex.Matches(res, patternStatus)[0].Value.Replace("\"status\":", "");
|
|
|
|
|
|
|
|
|
|
if (status != "1")
|
|
|
|
|
{
|
2019-08-30 16:48:34 +08:00
|
|
|
|
Console.WriteLine("Install Failed. Please check your network connection and try again.");
|
2019-08-25 21:46:42 +08:00
|
|
|
|
Console.ReadLine();
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string downloadURL = Regex.Matches(res, patternDownloadURL)[0].Value.Replace("\"downloadURL\":\"", "").Replace("\",", "");
|
2019-08-31 22:04:15 +08:00
|
|
|
|
string fileSha256 = Regex.Matches(res, patternSha256)[0].Value.Replace("\"sha256\":\"", "").Replace("\",", "");
|
2019-08-25 21:46:42 +08:00
|
|
|
|
|
|
|
|
|
Mkdir("C:\\WINDOWS\\dc-agent");
|
|
|
|
|
Mkdir("C:\\WINDOWS\\dc-agent\\log");
|
|
|
|
|
Mkdir("C:\\WINDOWS\\dc-agent\\bin");
|
2019-09-01 01:44:55 +08:00
|
|
|
|
|
|
|
|
|
if (systemVersion < 6.3) downloadURL = downloadURL.Replace("https:", "http:");
|
2019-08-31 22:04:15 +08:00
|
|
|
|
|
2019-08-25 21:46:42 +08:00
|
|
|
|
DownLoadOneFile(downloadURL, "C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe");
|
2019-08-25 23:46:35 +08:00
|
|
|
|
|
2019-08-31 22:04:15 +08:00
|
|
|
|
string checkSha256 = GetChecksum("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe");
|
|
|
|
|
|
|
|
|
|
if (checkSha256 != fileSha256)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(checkSha256);
|
|
|
|
|
Console.WriteLine(fileSha256);
|
|
|
|
|
Console.WriteLine("Error: File sha256 check failed.");
|
|
|
|
|
Console.ReadLine();
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-25 21:46:42 +08:00
|
|
|
|
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "install"));
|
|
|
|
|
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "start"));
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Install success!");
|
|
|
|
|
Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
else if (cmd == "2")
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "stop"));
|
|
|
|
|
Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "remove"));
|
2019-09-02 19:16:12 +08:00
|
|
|
|
runCmd("taskkill /fi \"imagename eq node.exe\" /f");
|
2019-08-25 21:46:42 +08:00
|
|
|
|
|
|
|
|
|
Thread.Sleep(1500);
|
|
|
|
|
|
|
|
|
|
runCmd("rd /s /q C:\\WINDOWS\\dc-agent\\");
|
|
|
|
|
|
2019-08-25 23:30:03 +08:00
|
|
|
|
DeleteDir("C:\\WINDOWS\\dc-agent\\");
|
|
|
|
|
|
2019-08-25 21:46:42 +08:00
|
|
|
|
Console.WriteLine("Uninstall success!");
|
|
|
|
|
Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Console.WriteLine(ExecuteOutCmd("C:\\WINDOWS\\dc-agent\\bin\\dc-agent.exe", "start"));
|
|
|
|
|
// Console.ReadLine();
|
|
|
|
|
Environment.Exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("You need to be administrator to perform this command.");
|
|
|
|
|
Console.WriteLine("请以管理员权限运行此程序");
|
|
|
|
|
|
|
|
|
|
Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|