2011-01-21 52 views
0

考慮下面的圖片:如何訪問解決方案項目? C#的WinForms

alt text

我如何可以訪問Queries.resx

以下是.resx文件中的內容。我想獲得價值。 alt text

+0

您是否使用Visual Studio Express(不支持解決方案文件夾)?否則當你雙擊文件時會發生什麼? – stuartd 2011-01-21 16:03:05

+0

雙擊它?右鍵點擊並選擇「打開方式...」? – David 2011-01-21 16:03:31

回答

1
// Create a ResXResourceReader for the file items.resx. 
ResXResourceReader rsxr = new ResXResourceReader(@"C:\Resource1.resx"); 

// Create an IDictionaryEnumerator to iterate through the resources. 
IDictionaryEnumerator id = rsxr.GetEnumerator(); 

// Iterate through the resources and display the contents 
foreach (DictionaryEntry d in rsxr) 
{ 
    Console.WriteLine("Key: {0} Value: {1}",  
           d.Key.ToString(),d.Value.ToString()); 
} 
相關問題