ResourceWriter Class
Writes resources in the system-default format to an output file or an output stream. This class cannot be inherited.
Assembly: mscorlib (in mscorlib.dll)
ResourceWriter provides a default implementation of the IResourceWriter interface.
Resources are specified as name and value pairs using the AddResource method. Resource names are case-sensitive when used for lookups, but to more easily support authoring tools and help eliminate bugs, ResourceWriter will not allow a .resources file to have names that vary only by case.
To create a resources file, create a ResourceWriter with a unique file name, call AddResource at least once, call Generate to write the resources file to disk, and then call Close to close the file. Calling Close will implicitly call Generate if you do not explicitly call Generate.
The resources will not necessarily be written in the same order they were added.
The following example writes several strings into the myResources.resources file.
Imports System Imports System.Resources Public Class WriteResources Public Shared Sub Main() ' Creates a resource writer. Dim writer As New ResourceWriter("myResources.resources") ' Adds resources to the resource writer. writer.AddResource("String 1", "First String") writer.AddResource("String 2", "Second String") writer.AddResource("String 3", "Third String") ' Writes the resources to the file or stream, and closes it. writer.Close() End Sub End Class
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.