Выполнение кода / скрипта во время восстановления запуска Windows

Привет, я пишу это расширение, это получает следующую сотню за каждый номер, который вы передаете

/// <summary>
    /// this extension gets the next hunfìdred for any number you whant
    /// </summary>
    /// <param name="i">numeber to rounded</param>
    /// <returns>the next hundred number</returns>
    /// <remarks>
    /// eg.:
    /// i =   21 gets 100
    /// i =  121 gets 200
    /// i =  200 gets 300
    /// i = 1211 gets 1300
    /// i = -108 gets -200
    /// </remarks>
    public static int RoundToNextHundred(this int i)
    {
        return i += (100 * Math.Sign(i) - i % 100);
        //use this line below if you want RoundHundred not NEXT
        //return i % 100 == byte.MinValue? i : i += (100 * Math.Sign(i) - i % 100);
    }

    //and for answer at title point use this algoritm
    var closeHundred = Math.Round(number / 100D)*100;

    //and here the extension method if you prefer

    /// <summary>
    /// this extension gets the close hundred for any number you whant
    /// </summary>
    /// <param name="number">number to be rounded</param>
    /// <returns>the close hundred number</returns>
    /// <remarks>
    /// eg.:
    /// number =   21 gets    0
    /// number =  149 gets  100
    /// number =  151 gets  200
    /// number = -149 gets -100
    /// number = -151 gets -200
    /// </remarks>
    public static int RoundCloseHundred(this int number)
    {
        return (int)Math.Round(number / 100D) * 100;
    }
1
задан Alex Nemkovich 26 February 2019 в 13:01
поделиться

1 ответ

Да, это возможно. Вы ищете Среду восстановления Windows , и вы можете добавить инструменты в эту среду.

Основные шаги включают:

  1. Создание файла XML, описывающего ваш инструмент
  2. Добавление инструмента и его XML в образ для восстановления (WinRE.wim) [113 ]
  3. Добавить инструмент в меню загрузки восстановления
0
ответ дан MSalters 26 February 2019 в 13:01
поделиться
Другие вопросы по тегам:

Похожие вопросы: