This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Threading; | |
| static class Program { | |
| static void Main() { | |
| Console.Write("Performing some task... "); | |
| using (var progress = new ProgressBar()) { | |
| for (int i = 0; i <= 100; i++) { | |
| progress.Report((double) i / 100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import Microsoft.Azure.Storage.DataMovement and all dependencies from Nuget, then have this: | |
| private static void Download() | |
| { | |
| ServicePointManager.DefaultConnectionLimit = Environment.ProcessorCount * 8; | |
| ServicePointManager.Expect100Continue = false; | |
| string storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=elatuse2mtrsprodsql;AccountKey=5LJ7KqzdaQlatfXcMMdJe0xw9jadzYR7VLo37GgMclaFZn5mwV58qszm9Azta5dfwJ5SJXPHKfuKsiIRAm/UyA==;"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I'm using nlog for my logger, and you need to add a reference to WUApiLib. You need a way to handle multiple reboots to do updates (which is what our custom StepResult bits do) | |
| private static Logger logger = LogManager.GetCurrentClassLogger(); | |
| public StepResult PerformAction() | |
| { | |
| UpdateSession session = new UpdateSession(); | |
| ISearchResult uResult; |
NewerOlder