File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
snippets/csharp/System/Environment/ExpandEnvironmentVariables Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,17 @@ class Sample
6
6
{
7
7
public static void Main ( )
8
8
{
9
- String str ;
10
- String nl = Environment . NewLine ;
9
+ // Keep this information secure!
10
+ string query = "My system drive is %SystemDrive% and my system root is %SystemRoot%" ;
11
11
12
- Console . WriteLine ( ) ;
13
- // <-- Keep this information secure! -->
14
- String query = "My system drive is %SystemDrive% and my system root is %SystemRoot%" ;
15
- str = Environment . ExpandEnvironmentVariables ( query ) ;
16
- Console . WriteLine ( "ExpandEnvironmentVariables: {0} {1}" , nl , str ) ;
12
+ string str = Environment . ExpandEnvironmentVariables ( query ) ;
13
+
14
+ Console . WriteLine ( str ) ;
17
15
}
18
16
}
19
17
/*
20
- This example produces the following results :
18
+ This example prints :
21
19
22
- ExpandEnvironmentVariables:
23
- My system drive is C: and my system root is C:\WINNT
20
+ My system drive is C: and my system root is C:\WINDOWS
24
21
*/
25
- //</snippet1>
22
+ //</snippet1>
You can’t perform that action at this time.
0 commit comments