Env

static class · namespace z3n7 · source Essentials/Env.cs

public static class Env

Reads settings from a .env file.

Methods

ReadEnv

public static string ReadEnv(this IZennoPosterProjectModel project, string key, bool global = false)

Extension method for IZennoPosterProjectModel. source

Returns the value of key from a .env file, or null when the file or the key is missing. Lines are KEY=value; empty lines and lines starting with # are skipped. The key is matched case-insensitively; surrounding single or double quotes are removed from the value.

Parameter Description
key Name of the setting.
global false: the file next to the project (project.Path). true: the file next to z3n7.dll.

Returns: The value, or null.