EnvironmentManager.SetEnvironmentVariable(String, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將指定環境變數的值設在目前 EnvironmentManager 的作用域。
public:
virtual void SetEnvironmentVariable(Platform::String ^ name, Platform::String ^ value) = SetEnvironmentVariable;
void SetEnvironmentVariable(winrt::hstring const& name, winrt::hstring const& value);
public void SetEnvironmentVariable(string name, string value);
function setEnvironmentVariable(name, value)
Public Sub SetEnvironmentVariable (name As String, value As String)
參數
- name
-
String
Platform::String
winrt::hstring
要設定的環境變數名稱。
- value
-
String
Platform::String
winrt::hstring
這是指定環境變數要設定的新值。
備註
要移除環境變數,請以空字串呼叫此方法。