I have a .net github project that is basically a wrapper around a web API. In the test project, I am calling to the API using an API key. I need to keep this key private, how do
You are probably looking for the App.config
file for a project. It will be copied to
when you compile it. Users can edit that config file as needed.
In that config file, you can add your API keys:
Then you can access it from your code using ConfigurationManager.AppSettings
:
string apiKey = ConfigurationManager.AppSettings["APIKey"];