Skip to content

Commit b6aa49d

Browse files
authored
add missing project file (#11500)
1 parent 63425e8 commit b6aa49d

File tree

4 files changed

+72
-59
lines changed

4 files changed

+72
-59
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Public Module Program
2+
3+
Public Sub Main()
4+
CountCulturesExample.RunIt()
5+
Module1.RunIt()
6+
End Sub
7+
8+
End Module
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>
Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
1-
' The following code example displays several properties of the neutral cultures.
2-
3-
' <snippet1>
4-
Imports System.Globalization
1+
Imports System.Globalization
52

63
Module Module1
74

8-
Public Sub Main()
9-
10-
' Displays several properties of the neutral cultures.
11-
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
12-
Dim ci As CultureInfo
13-
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
14-
Console.Write("{0,-7}", ci.Name)
15-
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
16-
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
17-
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
18-
Console.Write(" {0,-40}", ci.DisplayName)
19-
Console.WriteLine(" {0,-40}", ci.EnglishName)
20-
Next ci
21-
22-
End Sub
23-
24-
25-
26-
'This code produces the following output. This output has been cropped for brevity.
27-
'
28-
'CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
29-
'ar ar ara ARA Arabic Arabic
30-
'bg bg bul BGR Bulgarian Bulgarian
31-
'ca ca cat CAT Catalan Catalan
32-
'cs cs ces CSY Czech Czech
33-
'da da dan DAN Danish Danish
34-
'de de deu DEU German German
35-
'el el ell ELL Greek Greek
36-
'en en eng ENU English English
37-
'es es spa ESP Spanish Spanish
38-
'fi fi fin FIN Finnish Finnish
39-
'zh zh zho CHS Chinese Chinese
40-
'zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
41-
'zh-Hant zh zho ZHH Chinese (Traditional) Chinese (Traditional)
42-
'
43-
'Note: zh-Hant returns ZHH when using ICU (default). When NLS mode is enabled, it returns CHT.
5+
Public Sub RunIt()
6+
' <snippet1>
7+
8+
' Displays several properties of the neutral cultures.
9+
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
10+
Dim ci As CultureInfo
11+
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
12+
Console.Write("{0,-7}", ci.Name)
13+
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
14+
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
15+
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
16+
Console.Write(" {0,-40}", ci.DisplayName)
17+
Console.WriteLine(" {0,-40}", ci.EnglishName)
18+
Next ci
19+
20+
'This code produces the following output. This output has been cropped for brevity.
21+
'
22+
'CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
23+
'ar ar ara ARA Arabic Arabic
24+
'bg bg bul BGR Bulgarian Bulgarian
25+
'ca ca cat CAT Catalan Catalan
26+
'cs cs ces CSY Czech Czech
27+
'da da dan DAN Danish Danish
28+
'de de deu DEU German German
29+
'el el ell ELL Greek Greek
30+
'en en eng ENU English English
31+
'es es spa ESP Spanish Spanish
32+
'fi fi fin FIN Finnish Finnish
33+
'zh zh zho CHS Chinese Chinese
34+
'zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
35+
'zh-Hant zh zho ZHH Chinese (Traditional) Chinese (Traditional)
36+
'
37+
'Note: zh-Hant returns ZHH when using ICU (default). When NLS mode is enabled, it returns CHT.
38+
39+
' </snippet1>
40+
End Sub
4441

4542
End Module
46-
' </snippet1>

snippets/visualbasic/VS_Snippets_CLR_System/system.Globalization.CultureInfo.GetCultures/VB/getcultures3.vb

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
' <Snippet2>
2-
Imports System.Globalization
1+
Imports System.Globalization
32

4-
Module Example
5-
Sub Main()
6-
Dim cultures() As CultureInfo = CultureInfo.GetCultures(CultureTypes.UserCustomCulture Or
3+
Module CountCulturesExample
4+
Sub RunIt()
5+
' <Snippet2>
6+
Dim cultures() As CultureInfo = CultureInfo.GetCultures(CultureTypes.UserCustomCulture Or
77
CultureTypes.SpecificCultures)
8-
Dim ctr As Integer = 0
9-
For Each culture In cultures
10-
If (culture.CultureTypes And CultureTypes.UserCustomCulture) = CultureTypes.UserCustomCulture Then
11-
ctr += 1
12-
End If
13-
Next
14-
Console.WriteLine("Number of Specific Custom Cultures: {0}", ctr)
15-
End Sub
8+
Dim ctr As Integer = 0
9+
For Each culture In cultures
10+
If (culture.CultureTypes And CultureTypes.UserCustomCulture) = CultureTypes.UserCustomCulture Then
11+
ctr += 1
12+
End If
13+
Next
14+
Console.WriteLine("Number of Specific Custom Cultures: {0}", ctr)
15+
16+
' If run under Windows 8, the example displays output like the following:
17+
' Number of Specific Custom Cultures: 6
18+
' If run under Windows 10, the example displays output like the following:
19+
' Number of Specific Custom Cultures: 279
20+
' </Snippet2>
21+
End Sub
1622
End Module
17-
' If run under Windows 8, the example displays output like the following:
18-
' Number of Specific Custom Cultures: 6
19-
' If run under Windows 10, the example displays output like the following:
20-
' Number of Specific Custom Cultures: 279
21-
' </Snippet2>

0 commit comments

Comments
 (0)