Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ int main()

/*
This example produces the following results:
(Any result that is lengthy, specific to the machine on which this sample was tested, or reveals information that should remain secure, has been omitted and marked S"!---OMITTED---!".)

MachineName: !---OMITTED---!
MachineName: MyDesktop
*/
//</snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public static void Main()
}
/*
This example produces the following results:
(Any result that is lengthy, specific to the machine on which this sample was tested, or reveals information that should remain secure, has been omitted and marked "!---OMITTED---!".)

MachineName: !---OMITTED---!
MachineName: MyDesktop
*/
//</snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ open System
printfn $"\nMachineName: {Environment.MachineName}"

// This example produces the following results:
// (Any result that is lengthy, specific to the machine on which this sample was tested, or reveals information that should remain secure, has been omitted and marked "!---OMITTED---!".)
//
// MachineName: !---OMITTED---!
// MachineName: MyDesktop
//</snippet1>
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ Class Sample
End Class
'
'This example produces the following results:
'(Any result that is lengthy, specific to the machine on which this sample was tested,
'or reveals information that should remain secure, has been omitted
'and marked "!---OMITTED---!".)
'
'MachineName: !---OMITTED---!
'MachineName: MyDesktop
'
'</snippet1>
2 changes: 1 addition & 1 deletion xml/System/Environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ The following example creates environment variables for the <xref:System.Environ
The name of this computer is established at system startup when the name is read from the registry. If this computer is a node in a cluster, the name of the node is returned.

## Examples
The following example displays the name of the computer that runs the code example. (The machine name is omitted from the example output for security reasons.)
The following example displays the name of the computer that runs the code example. An example computer name has been given here, however you should never reveal your computers name for security reasons.

:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/Environment.MachineName/CPP/machinename.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System/Environment/MachineName/machinename.cs" id="Snippet1":::
Expand Down