Skip to content

Add missing project file #11500

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
@@ -0,0 +1,8 @@
Public Module Program

Public Sub Main()
CountCulturesExample.RunIt()
Module1.RunIt()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
' The following code example displays several properties of the neutral cultures.

' <snippet1>
Imports System.Globalization
Imports System.Globalization

Module Module1

Public Sub Main()

' Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
Dim ci As CultureInfo
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
Console.Write("{0,-7}", ci.Name)
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
Console.Write(" {0,-40}", ci.DisplayName)
Console.WriteLine(" {0,-40}", ci.EnglishName)
Next ci

End Sub



'This code produces the following output. This output has been cropped for brevity.
'
'CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
'ar ar ara ARA Arabic Arabic
'bg bg bul BGR Bulgarian Bulgarian
'ca ca cat CAT Catalan Catalan
'cs cs ces CSY Czech Czech
'da da dan DAN Danish Danish
'de de deu DEU German German
'el el ell ELL Greek Greek
'en en eng ENU English English
'es es spa ESP Spanish Spanish
'fi fi fin FIN Finnish Finnish
'zh zh zho CHS Chinese Chinese
'zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
'zh-Hant zh zho ZHH Chinese (Traditional) Chinese (Traditional)
'
'Note: zh-Hant returns ZHH when using ICU (default). When NLS mode is enabled, it returns CHT.
Public Sub RunIt()
' <snippet1>

' Displays several properties of the neutral cultures.
Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME")
Dim ci As CultureInfo
For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
Console.Write("{0,-7}", ci.Name)
Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
Console.Write(" {0,-40}", ci.DisplayName)
Console.WriteLine(" {0,-40}", ci.EnglishName)
Next ci

'This code produces the following output. This output has been cropped for brevity.
'
'CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME
'ar ar ara ARA Arabic Arabic
'bg bg bul BGR Bulgarian Bulgarian
'ca ca cat CAT Catalan Catalan
'cs cs ces CSY Czech Czech
'da da dan DAN Danish Danish
'de de deu DEU German German
'el el ell ELL Greek Greek
'en en eng ENU English English
'es es spa ESP Spanish Spanish
'fi fi fin FIN Finnish Finnish
'zh zh zho CHS Chinese Chinese
'zh-Hans zh zho CHS Chinese (Simplified) Chinese (Simplified)
'zh-Hant zh zho ZHH Chinese (Traditional) Chinese (Traditional)
'
'Note: zh-Hant returns ZHH when using ICU (default). When NLS mode is enabled, it returns CHT.

' </snippet1>
End Sub

End Module
' </snippet1>
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
' <Snippet2>
Imports System.Globalization
Imports System.Globalization

Module Example
Sub Main()
Dim cultures() As CultureInfo = CultureInfo.GetCultures(CultureTypes.UserCustomCulture Or
Module CountCulturesExample
Sub RunIt()
' <Snippet2>
Dim cultures() As CultureInfo = CultureInfo.GetCultures(CultureTypes.UserCustomCulture Or
CultureTypes.SpecificCultures)
Dim ctr As Integer = 0
For Each culture In cultures
If (culture.CultureTypes And CultureTypes.UserCustomCulture) = CultureTypes.UserCustomCulture Then
ctr += 1
End If
Next
Console.WriteLine("Number of Specific Custom Cultures: {0}", ctr)
End Sub
Dim ctr As Integer = 0
For Each culture In cultures
If (culture.CultureTypes And CultureTypes.UserCustomCulture) = CultureTypes.UserCustomCulture Then
ctr += 1
End If
Next
Console.WriteLine("Number of Specific Custom Cultures: {0}", ctr)

' If run under Windows 8, the example displays output like the following:
' Number of Specific Custom Cultures: 6
' If run under Windows 10, the example displays output like the following:
' Number of Specific Custom Cultures: 279
' </Snippet2>
End Sub
End Module
' If run under Windows 8, the example displays output like the following:
' Number of Specific Custom Cultures: 6
' If run under Windows 10, the example displays output like the following:
' Number of Specific Custom Cultures: 279
' </Snippet2>