示例#1
0
        public static void CheckMD5(string url_with_official_md5, [Optional] string optional_message_to_show_when_modified)
        {
            WebClient webClient   = new WebClient();
            string    websitehash = webClient.DownloadString(url_with_official_md5);
            string    programhash = KyeString.GetThisMD5();
            string    programname = AppDomain.CurrentDomain.FriendlyName.Replace(".exe", "");

            if (!websitehash.Contains(programhash))
            {
                if (optional_message_to_show_when_modified == null)
                {
                    MessageBox.Show("This program has been modified and is NOT official. Please download the original one", programname, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Environment.Exit(0);
                }
                else
                {
                    MessageBox.Show(optional_message_to_show_when_modified, programname, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Environment.Exit(0);
                }
            }
            webClient.Dispose();
        }
示例#2
0
        public static int GetGPUCount()
        {
            int gpucount = KyeString.GetGPU().Length - 1;

            return(gpucount);
        }