Update Methods.cs

This commit is contained in:
NYAN CAT 2019-05-26 23:02:41 +03:00
parent 24903ebbfa
commit d80b2d6ba8

View File

@ -1,6 +1,7 @@
using Client.Sockets;
using System;
using System.IO;
using System.Net.Sockets;
using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
@ -53,12 +54,17 @@ namespace Client.Helper
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
}
public static void ClientExit()
{
try
{
if (Convert.ToBoolean(Settings.BDOS) && IsAdmin())
ProcessCritical.Exit();
CloseMutex();
ClientSocket.Client?.Shutdown(SocketShutdown.Both);
ClientSocket.SslClient?.Close();
ClientSocket.Client?.Close();
}
catch { }
}
}
}