.net framework里有现成的,在第一张光盘搜索reseditor,可以编辑.resx和.resource

解决方案 »

  1.   

    老三,我说的是.res资源模板文件,是VB6或是VC++中的,不是你所说的.resx和.resource.
      

  2.   

    System.Resources.ResourceReader
                 and
    System.Resources.ResourceWriter
      

  3.   

    TO: cometsky(天空中自由翱翔的彗星)
    我说的是.res文件不是.resx和.resource文件
    用ResourceReader读的时候报错。无效的文件格式。但.res绝对是好的。
      

  4.   

    Try this:[DllImport("kernel32.dll")]
    public static extern IntPtr FindResource(int hModule,
           [MarshalAs(UnmanagedType.LPWStr)] string lpName,
           [MarshalAs(UnmanagedType.LPWStr)] string lpType);
      

  5.   

    or[DllImport("kernel32.dll")]
    public static extern IntPtr FindResource(IntPtr hModule,
           [MarshalAs(UnmanagedType.LPWStr)] string lpName,
           [MarshalAs(UnmanagedType.LPWStr)] string lpType);
      

  6.   

    hModulec参数是指向.exe或.dll的句柄,我是打开一个存在的.res文件,并在C#中调用,那么我将hModule的值设为什么好?
    假如res文件是1.res,
    我的调用方法是FindResource(0,"1.res","RT_STRING"),这样的返回结果是0,这是不对的,那么对的应该怎么写?
      

  7.   

    To  thinkc(【抗火,抗冰冻,抗闪电,物理攻击无效】) Try this:
    [DllImport("kernel32.dll")]
    public static extern IntPtr FindResource(IntPtr hModule,
           [MarshalAs(UnmanagedType.LPWStr)] string lpName,
           [MarshalAs(UnmanagedType.LPWStr)] string lpType);FindResource(IntPtr.Zero,"1.res","RT_STRING")