Пример #1
0
        public frmMain()
        {
            InitializeComponent();

            this.Text = "Restart2UEFI(WinForms)" + (typeof(Program).GetTypeInfo().Assembly.GetName().Version).ToString();

            try
            {
                int fwareT = int.Parse(FirmwareType.GetFirmwareType().ToString());
                switch (fwareT)
                {
                case 0:
                    errorNotUefi();
                    fwType = "0";
                    break;

                case 1:
                    errorNotUefi();
                    fwType = "1";
                    break;

                case 2:
                    firmWareUEFI();
                    break;

                case 3:
                    errorNotUefi();
                    fwType = "3";
                    break;

                default:
                    errorRetrive();
                    break;
                }
            }
            catch
            {
                errorRetrive();
            }
        }
Пример #2
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            //Get firmware return type FirmwareTypeUnknown  = 0, FirmwareTypeBios = 1, FirmwareTypeUefi = 2, FirmwareTypeMax = 3
            int fwareT = int.Parse(FirmwareType.GetFirmwareType().ToString());

            fwType = fwareT.ToString();

            try
            {
                switch (fwareT)
                {
                case 0:
                    errorNotUefi();
                    break;

                case 1:
                    errorNotUefi();
                    break;

                case 2:

                    firmWareUEFI();
                    break;

                case 3:
                    errorNotUefi();
                    break;

                default:
                    errorRetrive();
                    break;
                }
            }
            catch
            {
                errorRetrive();
            }
        }