Environment Variables are set of values that are used for running special processes or special system files.. for example when you install java or python you must make a new environment variable in order to compile and run java or python programs that's all I know about it. Without wasting anytime let's get into it...
This is a simple code that will show you the environment variables..
For VB.NET
Dim EV As String = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process Or EnvironmentVariableTarget.Machine) MsgBox(EV)
For C#
'you must add these namespaces using System; using System.IO; using System.Windows.Forms; using Microsoft.Win32; 'add this code in an event string EV = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process | EnvironmentVariableTarget.Machine); MessageBox.Show(EV);
The "PATH" defines the environment variable name so if you want to get another ones just change PATH with the variable name.
3 comments
PLZ BB I STOLE DAT DANK MEME LOLOLOLOL NO WATER MRK
Reply#If...Then...#Else Directive
Reply#Region...#End Region Directive
Abs Function
Beep Procedure
Call Statement
DateAdd Function
datevalue
Directory.CreateDirectory Method
E Field
File Class
For Each...Next Statement
Get Statement
Handles Keyword
IDataObject Interface
Inherits Statement
Join Function
Kill Procedure
LBound Function
Max Function
Namespace Statement
Oct Functions
Partition Function
QBColor Function
RaiseEvent Statement
SaveFileDialog Class
csharp codes has good content about c#, c++
ReplyPost a Comment
Note: Only a member of this blog may post a comment.