dotnet / dotnet/dotnet-api-docs

The example seems to contain comments meant for internal (Microsoft) use

Open
#856 4 comments 0 reactions 0 assignees View on GitHub
area-System.Runtime doc-enhancement dotnet-api/prod example-request Pri2
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

In the code example given on the page, there are several comments that say `<-- Keep this information secure! -->`:

```
// <-- Keep this information secure! -->
Console.WriteLine("CurrentDirectory: {0}", Environment.CurrentDirectory);

// <-- Keep this information secure! -->
Console.WriteLine("MachineName: {0}", Environment.MachineName);
```

This is confusing. It started to make sense when I looked at the result of the code sample:

> This example produces results similar to the following:
> (Any result that is lengthy or reveals information that should remain
secure has been omitted and marked "!---OMITTED---!".)
> …
> CurrentDirectory: C:\Documents and Settings\!---OMITTED---!
> ...
> MachineName: !---OMITTED---!

So it looks like those "keep this information secure" comments are meant for the documentation author as a reminder to redact sensitive information. At the moment those comments are confusing, and it may be worth removing them or adding context for the reader.

Also, I noticed that code indentation needs to be corrected as well.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: cb3fdf17-2772-6fbc-e62f-fb92a204d317
* Version Independent ID: 1918599a-dc61-962c-6227-b51684b51649
* Content: [Environment Class (System)](https://docs.microsoft.com/en-us/dotnet/api/system.environment?view=netframework-4.7.2)
* Content Source: [xml/System/Environment.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/Environment.xml)
* Product: **dotnet-api**
* GitHub Login: @rpetrusha
* Microsoft Alias: **ronpet**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.