JScript 8.0 中文手册| 首页 | asp之家
/resource

将托管资源嵌入程序集。

/resource:filename[,name[,public|private]]
-or-
/res:filename[,name[,public|private]]
参数
filename

要在输出文件中嵌入的资源文件。

name[,public|private](可选)

资源的逻辑名称;用于加载此资源的名称。默认为文件的名称。还可以指定该文件在程序集清单中是公共的还是私有的。例如,/res:filename.res,myname.res,public。默认情况下,filename 在程序集中是公共的。

备注

使用 /resource 选项将资源链接到程序集,而不将资源文件放入输出文件中。

例如,如果 filename 是由资源文件生成器 (Resgen.exe) 创建或在开发环境中创建的 .NET Framework 资源文件,则可以使用 System.Resources 命名空间中的成员来访问它(有关更多信息,请参见 System.Resources.ResourceManager)。对于所有其他资源,请使用 System.Reflection.Assembly 类中的 GetManifestResource* 方法在运行时访问资源。

/res 是 /resource 的缩写形式。

示例

编译 in.js 并附加资源文件 rf.resource:

jsc /res:rf.resource in.js
请参见

其他资源

JScript 编译器选项