Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created July 8, 2017 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/1efad8bdf3f3ae4217fd1aadc5423b8d to your computer and use it in GitHub Desktop.
Save dance2die/1efad8bdf3f3ae4217fd1aadc5423b8d to your computer and use it in GitHub Desktop.
Using Environment variables to access API key values
using System;
namespace MyAnimeListSharp.Auth
{
public class CredentialContext : ICredentialContext
{
public string UserName { get; set; } =
Environment.GetEnvironmentVariable("Project_MyAnimeList.UserName", EnvironmentVariableTarget.User);
public string Password { get; set; } =
Environment.GetEnvironmentVariable("Project_MyAnimeList.Password", EnvironmentVariableTarget.User);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment