Resgen.exe (Resource File Generator)
The Resource File Generator (Resgen.exe) converts text (.txt or .restext) files and XML-based resource format (.resx) files to common language runtime binary (.resources) files that can be embedded in a runtime binary executable or satellite assembly. (See Creating Resource Files.)
Resgen.exe is a general-purpose resource conversion utility that performs the following tasks:
Converts .txt or .restext files to .resources or .resx files. (The format of .restext files is identical to the format of .txt files. However, the .restext extension helps you identify text files that contain resource definitions more easily.)
Converts .resources files to text or .resx files.
Converts .resx files to text or .resources files.
Extracts the string resources from an assembly into a .resw file that is suitable for use in a Windows 8.x Store app.
Creates a strongly typed class that provides access to individual named resources and to the ResourceManager instance.
If Resgen.exe fails for any reason, the return value is –1.
To get help with Resgen.exe, you can use the following command, with no options specified, to display the command syntax and options for Resgen.exe:
You can also use the /? switch:
If you use Resgen.exe to generate binary .resources files, you can use a language compiler to embed the binary files into executable assemblies, or you can use the Assembly Linker (Al.exe) to compile them into satellite assemblies.
This tool is automatically installed with Visual Studio. To run the tool, use Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell.
At the command prompt, type the following:
Syntax
Parameters
Parameter or switch | Description |
---|---|
/define: symbol1[, symbol2. ] | Starting with the .NET Framework 4.5, supports conditional compilation in text-based (.txt or .restext) resource files. If symbol corresponds to a symbol included in the input text file within a #ifdef construct, the associated string resource is included in the .resources file. If the input text file includes an #if ! statement with a symbol that is not defined by the /define switch, the associated string resource is included in the resources file. |
/define is ignored if it is used with non-text files. Symbols are case-sensitive.
For more information about this option, see Conditionally Compiling Resources later in this topic.
This option cannot be used with the /str: option.
For more information about this option, see Compiling or Converting Multiple Files later in this topic.
.txt or .restext
A text file to convert to a .resources or a .resx file. Text files can contain only string resources. For information about the file format, see the «Resources in Text Files» section of Creating Resource Files.
.resx
An XML-based resource file to convert to a .resources or a text (.txt or .restext) file.
.resources
A binary resource file to convert to a .resx or a text (.txt or .restext) file.
If you’re using the second, shorter command-line syntax presented before this table, extension must be the following:
.exe or .dll
A .NET Framework assembly (executable or library) whose string resources are to be extracted to a .resw file for use in developing Windows 8.x Store apps.
This argument is optional when converting from a .txt, .restext, or .resx file to a .resources file. If you do not specify outputFilename , Resgen.exe appends a .resources extension to the input filename and writes the file to the directory that contains filename,extension .
The outputFilename.extension argument is mandatory when converting from a .resources file. Specify a file name with the .resx extension when converting a .resources file to an XML-based resource file. Specify a file name with the .txt or .restext extension when converting a .resources file to a text file. You should convert a .resources file to a .txt file only when the .resources file contains only string values.
— For C#: c# , cs , or csharp .
— For Visual Basic: vb or visualbasic .
— For VBScript: vbs or vbscript .
— For C++: c++ , mc , or cpp .
— For JavaScript: js , jscript , or javascript .
The namespace option specifies the project’s default namespace, the classname option specifies the name of the generated class, and the filename option specifies the name of the class file.
The /str: option allows only one input file, so it cannot be used with the /compile option.
If namespace is specified but classname is not, the class name is derived from the output file name (for example, underscores are substituted for periods). The strongly typed resources might not work correctly as a result. To avoid this, specify both class name and output file name.
For more information about this option, see Generating a Strongly Typed Resource Class later in this topic.
This option is ignored if the /str: option is not used.
Resgen.exe and Resource File Types
In order for Resgen.exe to successfully convert resources, text and .resx files must follow the correct format.
Text (.txt and .restext) Files
Text (.txt or .restext) files may contain only string resources. String resources are useful if you are writing an application that must have strings translated into several languages. For example, you can easily regionalize menu strings by using the appropriate string resource. Resgen.exe reads text files that contain name/value pairs, where the name is a string that describes the resource and the value is the resource string itself.
For information about the format of .txt and .restext files, see the «Resources in Text Files» section of Creating Resource Files.
A text file that contains resources must be saved with UTF-8 or Unicode (UTF-16) encoding unless it contains only characters in the Basic Latin range (to U+007F). Resgen.exe removes extended ANSI characters when it processes a text file that is saved using ANSI encoding.
Resgen.exe checks the text file for duplicate resource names. If the text file contains duplicate resource names, Resgen.exe will emit a warning and ignore the second value.
.resx Files
The .resx resource file format consists of XML entries. You can specify string resources within these XML entries, as you would in text files. A primary advantage of .resx files over text files is that you can also specify or embed objects. When you view a .resx file, you can see the binary form of an embedded object (for example, a picture) when this binary information is a part of the resource manifest. As with text files, you can open a .resx file with a text editor (such as Notepad or Microsoft Word) and write, parse, and manipulate its contents. Note that this requires a good knowledge of XML tags and the .resx file structure. For more details on the .resx file format, see the «Resources in .resx Files» section of Creating Resource Files.
Resgen exe windows sdk
Suppir |
| ||
|
Voyager |
| ||
Опытный Профиль Репутация: 3 Установите Microsoft .NET Framework SDK Version 2.0 | |||
|
Suppir |
| ||
|
koroteeww |
| |||||||||
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, mr.DUDA, THandle.
[ Время генерации скрипта: 0.1257 ] [ Использовано запросов: 21 ] [ GZIP включён ] |