Answers for "Display environment variables"

C#
0

Display environment variables

public static void Main(string[] args)
{
    var host = CreateHostBuilder(args).Build();

    var config = host.Services.GetRequiredService<IConfiguration>();

    foreach (var c in config.AsEnumerable())
    {
        Console.WriteLine(c.Key + " = " + c.Value);
    }
    host.Run();
}
Posted by: Guest on September-10-2021

Code answers related to "Display environment variables"

C# Answers by Framework

Browse Popular Code Answers by Language