代码: ResourceManager rm = new ResourceManager("strings.zh-cn",Assembly.GetExecutingAssembly());
CultureInfo ci = new CultureInfo("es-ES");
string dd;
dd = rm.GetString("LoginName",ci);报错:
未能找到任何适合于指定的区域性或非特定区域性的资源。请确保在编译时已将“strings.zh-cn.resources”正确嵌入或链接到程序集“WindowsApplication3”,或者确保所有需要的附属程序集都可加载并已进行了完全签名。想得到loginname的值,报了上面的错误

解决方案 »

  1.   

    ResourceManager rm = new ResourceManager("strings",Assembly.GetExecutingAssembly());
    CultureInfo ci = new CultureInfo("es-ES");
    string dd;
    dd = rm.GetString("LoginName",ci);
      

  2.   

    你是WinForm的还是WebForm的程序阿?
      

  3.   

    首先你确保要存在strings.en-ES.resx的资源文件  
    ResourceManager rm = new ResourceManager(工程名(如WindowsApplication1)+"strings",Assembly.GetExecutingAssembly());
      

  4.   

    ResourceManager rm = new ResourceManager(工程名(如WindowsApplication1)+".strings",Assembly.GetExecutingAssembly());中间要加"."好
      

  5.   

    资源文件名是strings.zh-cn.resx
    你为什么要使用es-ES的文化信息?
      

  6.   

    现在我定义的是空"",可还是不行,还是刚刚的错,是不是我创建了resx还要做其它的操作?
      

  7.   

    你要使用en-ES的文化信息必须得要有strings.en-ES.resx的资源文件才可以
      

  8.   

    ~-~ 上班时间不让上QQ 把你strings.zh-cn.resx的资源文件复制一份,重命名为strings.en-ES.resx就可以了
      

  9.   

    ResourceManager rm = new ResourceManager("strings.zh-cn", Assembly.GetExecutingAssembly());
    CultureInfo ci = new CultureInfo("es-ES");
    string dd;
    dd = rm.GetString("loginname", ci);file:strings.en-ES.resx
         strings.zh-cn.resx
      

  10.   

    ResourceManager rm = new ResourceManager("strings.zh-cn", Assembly.GetExecutingAssembly());
    不要用       "strings.zh-cn"
    而要用       "strings"
      

  11.   

    ResourceManager rm = new ResourceManager("strings", Assembly.GetExecutingAssembly());
    CultureInfo ci = new CultureInfo("");
    string dd;
    dd = rm.GetString("loginname", ci);
    还是一样的问题,唉~
      

  12.   

    public ResourceManager (
    string baseName,
    Assembly assembly
    )baseName
    资源的根名称。例如,名为“MyResource.en-US.resources”的资源文件的根名称为“MyResource”。 assembly
    资源的主 Assembly。 
      

  13.   

    CultureInfo ci = new CultureInfo("en-ES");
    这里的文化信息还是要有的!
      

  14.   

    快不行了,还是不行,你能不能有个例子发到我邮箱里[email protected]