ResourceWriter Constructor (String^)

 

Initializes a new instance of the ResourceWriter class that writes the resources to the specified file.

Namespace:   System.Resources
Assembly:  mscorlib (in mscorlib.dll)

public:
ResourceWriter(
	String^ fileName
)

Parameters

fileName
Type: System::String^

The output file name.

Exception Condition
ArgumentNullException

The fileName parameter is null.

The following code example defines a new instance of the ResourceWriter class that will write to a specified file. The code adds resources to the writer and writes the resources to the file.

using namespace System;
using namespace System::Resources;
int main()
{

   // Creates a resource writer.
   IResourceWriter^ writer = gcnew 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();
}

.NET Framework
Available since 1.1
Return to top
Show: