C # set and get the system environment variables

C # settings and environment variables

1 Introduction

Originally want to take the school room of Android Editor glued directly onto their computer use and found that it is the eclipse
 32, and my 64-bit JDK, I think of two altogether installed JDK, C # to do with the ability to change a ring
 Environment variable program

2. Code

Static method in class Environment

Environment variables:

public static string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target);
 Parameters:
//   variable:
 // environment variable name.
//
//   target:
 One // System.EnvironmentVariableTarget value, location, environment variables.
    

Set the environment variable:

public static void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target);
Parameters:
//   variable:
 // environment variable name.
//
//   value:
 // variable value to be assigned to.
//
//   target:
 One // System.EnvironmentVariableTarget value, location, environment variables.

PS: This method of setting environment variables without restarting the computer can take effect! (If not the third parameter will only modify environment variables for the current process)

Intelligent Recommendation

java get system environment variables

Environment variable   Code   Output  ...

Python Get System Environment Variables

Linux execution Python Gets the way system environment variables.  ...

Linux set system environment variables

1, for the current terminal 2, for the current user (recommended) User directory (~ directory) under the .bash_profile or .bashrc hidden file, join in the last line 3, for all users (cautious) There a...

Ubuntu - set system environment variables

Introduction to environment variables The bash shell uses a feature called environment variable to store information about the shell session and the working environment. The use of environment variabl...

More Recommendation

ubuntu set system environment variables

1 Open the terminal and enter: sudo gedit /etc/environment。 2 Enter the user password. The password entered at this time is not visible. 3 As shown, add at the end of PATH="....": :/opt/Embe...

CentOS set system environment variables

1) The naive approach for the first attempt: Take the registration of golang environment variables as an example: It is not recommended to write directly/etc/profile, but create a new shell script wri...

Set system environment variables in django

[Recommended] 2019 Java Developers' Job-hopping Guide.pdf (Hematemesis Finishing) >>> demand: Due to system limitations, it is necessary to set system environment variables in the logic code ...

Ubuntu18.4 set system environment variables

Ubuntu18.4 set system environment variables Env View system environment variables Path path executable path ":" is the path interval Export Path = $ {path}: "Path" setting PATHCurr...

Set system variables and environment variables for php

Seeing this title, there are two questions, whether to set the system environment variable for php.exe or set the environment variable for the programming language to directly call the environment var...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top