首先,我有RFM和RFM,我尝试关注一些站点,但我无法掌握资源管理器的概念。
有人可以向我解释如何生成类似于 VS IDE 的资源管理器。
例如,如果我从命令行使用 VBC 编译,我可以看到我的所有资源文件。
vbc /t:exe myfile.vb /res:res1 /res:res2
Dim a as Assembly = Assembly.GetExecutingAssembly()
For Each i as string in a.GetManifestResourceNames()
Console.writeline(i)
Next i
资源1
资源2
如果我使用 VS IDE 编译,我只会看到:
我的程序.资源.资源
如何从命令行手动创建资源管理器,以便可以像使用 VS IDE 一样使用资源管理器?
Dim CurrentResourceManager As New ResourceManager(_
"myprogram.Resources", CurrentAssembly)
Dim CurrentResourceSet As ResourceSet = CurrentResourceManager.GetResourceSet( _
CultureInfo.CurrentCulture, True, True)
当我尝试使用 resgen 时,它抱怨我的文件扩展
C:...>resgen image.bmp myfile.Resource.resource 源
ResGen:错误 RG0000:名为“image.bmp”的文件没有已知的扩展名。托管资源文件必须以 .ResX、.txt 或 .resources 结尾。
在手册中它声明使用RESXGEN图像,但我不相信 VS2008 中可用。我被困住了。
更新:发现: http: //msdn.microsoft.com/en-us/library/ekyft91f (VS.80).aspx 解释如何编写 ResX 文件。似乎是一个可重复的过程。我不确定他们为什么不包含 Visual Studio 的实用程序来创建它。
我尝试使用 ResourceWriter 的示例。Resgen 在使用 MS 提供的 ResourceWriter 类时吐了。