winform取得资源文件的写法
ResourceManager rm = new ResourceManager("WindowsForms.Properties.Resources", Assembly.GetExecutingAssembly());
var text = rm.GetString("as");
提取字符串资源:
String s = ( ( String ) rm.GetString ( "MyStr" ) ) ;
提取图标资源:
Icon icoDemo = ( ( Icon ) rm.GetObject ( "demo.ico" ) ) ;
提取图象资源:
Image a = ( ( Image ) ( rm.GetObject ( "ok-off.png" ) ) ) ;
asp.net webform 也同样适用
ResourceManager rm = new ResourceManager("WebForm2.Properties.Resources", Assembly.GetExecutingAssembly());
result = rm.GetString("echartData");
是可以取到值的
大道三千,条条皆可证道。道心不可失。