Skip to content

Commit 1d2a490

Browse files
authored
Merge pull request #18961 from tdykstra/chgsnippettag
Change snippet tag
2 parents 9d0c94d + 6889f10 commit 1d2a490

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docs/core/tutorials/snippets/with-visual-studio/csharp/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ public class HelloWorld
99
{
1010
public static void Main(string[] args)
1111
{
12-
// <Snippet1>
12+
// <MainMethod>
1313
Console.WriteLine("\nWhat is your name? ");
1414
var name = Console.ReadLine();
1515
var date = DateTime.Now;
1616
Console.WriteLine($"\nHello, {name}, on {date:d} at {date:t}!");
1717
Console.Write("\nPress any key to exit...");
1818
Console.ReadKey(true);
19-
// </Snippet1>
19+
// </MainMethod>
2020
}
2121
}
2222
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Module Program
22
Sub Main(args As String())
3-
' <Snippet1>
3+
' <MainMethod>
44
Console.WriteLine(vbCrLf + "What is your name? ")
55
Dim name = Console.ReadLine()
66
Dim currentDate = DateTime.Now
77
Console.WriteLine($"{vbCrLf}Hello, {name}, on {currentDate:d} at {currentDate:t}")
88
Console.Write(vbCrLf + "Press any key to exit... ")
99
Console.ReadKey(True)
10-
' </Snippet1>
10+
' </MainMethod>
1111
End Sub
1212
End Module

docs/core/tutorials/with-visual-studio-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Enhance the application to prompt the user for their name and display it along w
8383

8484
1. Replace the contents of the `Main` method in *Program.cs*, which is the line that calls `Console.WriteLine`, with the following code:
8585

86-
:::code language="csharp" source="./snippets/with-visual-studio/csharp/Program.cs" id="1":::
86+
:::code language="csharp" source="./snippets/with-visual-studio/csharp/Program.cs" id="MainMethod":::
8787

8888
This code displays "What is your name?" in the console window and waits until the user enters a string followed by the <kbd>Enter</kbd> key. It stores this string in a variable named `name`. It also retrieves the value of the <xref:System.DateTime.Now?displayProperty=nameWithType> property, which contains the current local time, and assigns it to a variable named `date`. Finally, it displays these values in the console window.
8989

docs/core/tutorials/with-visual-studio-mac.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Enhance the application to prompt the user for their name and display it along w
7878

7979
1. In *Program.cs*, replace the contents of the `Main` method, which is the line that calls `Console.WriteLine`, with the following code:
8080

81-
:::code language="csharp" source="./snippets/with-visual-studio/csharp/Program.cs" id="1":::
81+
:::code language="csharp" source="./snippets/with-visual-studio/csharp/Program.cs" id="MainMethod":::
8282

8383
This code displays "What is your name?" in the console window and waits until the user enters a string followed by the <kbd>enter</kbd> key. It stores this string in a variable named `name`. It also retrieves the value of the <xref:System.DateTime.Now?displayProperty=nameWithType> property, which contains the current local time, and assigns it to a variable named `date`. Finally, it displays these values in the console window.
8484

docs/core/tutorials/with-visual-studio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Enhance the application to prompt the user for their name and display it along w
8787

8888
1. In *Program.cs* or *Program.vb*, replace the contents of the `Main` method, which is the line that calls `Console.WriteLine`, with the following code:
8989

90-
[!code-csharp[GettingStarted#1](./snippets/with-visual-studio/csharp/Program.cs#1)]
91-
[!code-vb[GettingStarted#1](./snippets/with-visual-studio/vb/Program.vb#1)]
90+
:::code language="csharp" source="./snippets/with-visual-studio/csharp/Program.cs" id="MainMethod":::
91+
:::code language="vb" source="./snippets/with-visual-studio/vb/Program.vb" id="MainMethod":::
9292

9393
This code displays "What is your name?" in the console window and waits until the user enters a string followed by the <kbd>Enter</kbd> key. It stores this string in a variable named `name`. It also retrieves the value of the <xref:System.DateTime.Now?displayProperty=nameWithType> property, which contains the current local time, and assigns it to a variable named `date` (`currentDate` in Visual Basic). Finally, it displays these values in the console window.
9494

0 commit comments

Comments
 (0)