Skip to content

Commit 8d169a1

Browse files
authored
output improvements (#4514)
1 parent bf816bf commit 8d169a1

File tree

3 files changed

+48
-15
lines changed
  • samples/snippets
    • csharp/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/CS
    • visualbasic/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/vb
  • xml/System

3 files changed

+48
-15
lines changed

samples/snippets/csharp/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/CS/sample.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,22 @@ public static void PrintHashMultiBlock(byte[] input, int size)
6161
Console.WriteLine("MultiBlock {0:00}: {1}", size, BytesToStr(sha.Hash));
6262
}
6363
}
64+
/*
65+
This example produces output similar to the following:
66+
67+
Input : 45D97219908A572DE336B9DEC787C311D3349F69
68+
69+
ComputeHash : 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
70+
FinalBlock : 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
71+
MultiBlock 01: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
72+
MultiBlock 02: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
73+
MultiBlock 03: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
74+
MultiBlock 05: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
75+
MultiBlock 10: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
76+
MultiBlock 11: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
77+
MultiBlock 19: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
78+
MultiBlock 20: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
79+
MultiBlock 21: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
80+
81+
*/
6482
// </Snippet1>

samples/snippets/visualbasic/VS_Snippets_CLR/Cryptography.HashAlgorithm.TransformFinalBlock/vb/sample.vb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,20 @@ Class Program
5757
Console.WriteLine("MultiBlock {0:00}: {1}", size, BytesToStr(sha.Hash))
5858
End Sub
5959
End Class
60+
61+
' This example produces output similar to the following:
62+
'
63+
' Input : 45D97219908A572DE336B9DEC787C311D3349F69
64+
'
65+
' ComputeHash : 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
66+
' FinalBlock : 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
67+
' MultiBlock 01: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
68+
' MultiBlock 02: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
69+
' MultiBlock 03: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
70+
' MultiBlock 05: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
71+
' MultiBlock 10: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
72+
' MultiBlock 11: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
73+
' MultiBlock 19: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
74+
' MultiBlock 20: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
75+
' MultiBlock 21: 84E87322C7E3BCA848B0A698EE66E9A9725DA786F9FD4FFD46C385F59AB35B15
6076
' </Snippet1>

xml/System/Type.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,13 +2392,13 @@ This example shows the output of the <xref:System.Type.GetConstructors> overload
23922392
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/CS/source1.cs" interactive="try-dotnet" id="Snippet1":::
23932393
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source1.vb" id="Snippet1":::
23942394

2395-
The output of this code is:
2396-
2397-
2
2398-
2399-
False
2400-
2401-
False
2395+
The output of this code is:
2396+
2397+
```output
2398+
2
2399+
False
2400+
False
2401+
```
24022402

24032403
Because the <xref:System.Type.GetConstructors%2A> overload uses only <xref:System.Reflection.BindingFlags.Public> and <xref:System.Reflection.BindingFlags.Instance>, the static constructor is neither counted by the `for` expression nor evaluated by `IsStatic`.
24042404

@@ -2409,14 +2409,13 @@ This example shows the output of the <xref:System.Type.GetConstructors> overload
24092409
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_Classic/classic Type.GetConstructors Example/VB/source2.vb" id="Snippet2":::
24102410

24112411
Now the output is:
2412-
2413-
3
2414-
2415-
False
2416-
2417-
True
2418-
2419-
False
2412+
2413+
```output
2414+
3
2415+
False
2416+
True
2417+
False
2418+
```
24202419

24212420
]]></format>
24222421
</remarks>

0 commit comments

Comments
 (0)