|
@@ -69,11 +69,10 @@ namespace XdCxRhDW
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
- static void RestartAsAdmin(string[] args)
|
|
|
+ static void RestartAsAdmin()
|
|
|
{
|
|
|
var startInfo = new ProcessStartInfo();
|
|
|
startInfo.FileName = Application.ExecutablePath;
|
|
|
- startInfo.Arguments =string.Join(" ",args);
|
|
|
startInfo.Verb = "runas"; // 以管理员身份运行
|
|
|
try
|
|
|
{
|
|
@@ -91,12 +90,8 @@ namespace XdCxRhDW
|
|
|
/// 应用程序的主入口点。
|
|
|
/// </summary>
|
|
|
[STAThread]
|
|
|
- static void Main(string[] args)
|
|
|
+ static void Main()
|
|
|
{
|
|
|
- if (args.Length > 0 && args[0].Trim().ToLower()=="debug")
|
|
|
- {
|
|
|
- AppConst.Debug = true;
|
|
|
- }
|
|
|
string outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine} {Exception}";
|
|
|
Serilog.Log.Logger = new Serilog.LoggerConfiguration()
|
|
|
.WriteTo.Console(outputTemplate: outputTemplate)
|
|
@@ -138,7 +133,7 @@ namespace XdCxRhDW
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RestartAsAdmin(args);
|
|
|
+ RestartAsAdmin();
|
|
|
}
|
|
|
}
|
|
|
}
|