•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,708 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,441 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 5371 | Replies: 3
![]() |
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation:
Rep Power: 2
Solved Threads: 38
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation:
Rep Power: 2
Solved Threads: 38
•
•
Join Date: Nov 2006
Location: Bonners Ferry, ID
Posts: 279
Reputation:
Rep Power: 2
Solved Threads: 38
Solved myself
What I was trying to do was dynamically build a menu item for each
langauge that was added to the application. Each language gets is own directory example: en-US, ar-QA, ...
I needed to make sure I had the resource dll in the directory, then determine its name by using the hosting directory. Pass that name to CulturInfo, and build the menu.
The Code snip below was used to populate a combobox, and a version of this used to create my menu items.
What I was trying to do was dynamically build a menu item for each
langauge that was added to the application. Each language gets is own directory example: en-US, ar-QA, ...
I needed to make sure I had the resource dll in the directory, then determine its name by using the hosting directory. Pass that name to CulturInfo, and build the menu.
The Code snip below was used to populate a combobox, and a version of this used to create my menu items.
string langcode = "";
string startpath = Application.StartupPath;
foreach (string d in Directory.GetDirectories(@startpath))
{
foreach (string f in Directory.GetFiles(d, "Foo.resources.dll"))
{
string[] pathparts = d.Split('\\');
int ipaths = pathparts.GetUpperBound(0);
langcode = pathparts[ipaths];
CultureInfo ci = new CultureInfo(langcode);
cbDefaultLangauge.Items.Add(ci.NativeName+ " ("+ci.EnglishName+"):"+langcode);
}
}
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Directory Scanning (sort of) (Python)
- Problems with Directory.Move (C#)
- A agntsrvc.exe file error (Viruses, Spyware and other Nasties)
- directory/file listbox (Graphics and Multimedia)
- On execution of perl script, popup asks if i want to save or run this file (Linux Servers and Apache)
- Error including Parent directory files (ASP)
Other Threads in the C# Forum
- Previous Thread: Question about .Row.Add(new object[]{...,...}) Please help!
- Next Thread: Understanding array creation.


Linear Mode