environment_get_variable


描述

This function returns the value (a string) of the environment variable with the given name (also a string).

NOTE: This is a Windows only function.


语法:

environment_get_variable(name);

参数 描述
name The name (a string) of the environment variable to check.


返回:

String(字符串)


例如:

e_str = environment_get_variable("APPDATA");

The above code will return the full path for the environment variable "%appdata%", which is normally "C:\Users\{username}\AppData\Roaming".