2011-01-21 46 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()); 
} 
相关问题