WMEncProfile2.SaveToFile
![]() |
The SaveToFile method saves the current profile to a file.
Syntax
void WMEncProfile2.SaveToFile(
string bstrFileName
);
Parameters
bstrFileName
[in] String containing the file name.
Return Values
This method does not return a value.
Remarks
Before you save a profile, you can use the Validate method to ensure the profile has the required settings and to provide more detailed messages in case of an error. For example, if you forget to specify a profile name, the Validate method displays an error message telling you that a profile name is required.
Example Code
using WMEncoderLib;
try
{
// Create a WMEncProfile2 object.
WMEncProfile2 Pro;
Pro = new WMEncProfile2();
// Specify a name and content type for the profile.
Pro.Name = "My Profile";
Pro.ContentType = 16;
// Add an audience with a bit rate of 512 Kbps.
Pro.AddAudience(512000);
// Validate the profile settings.
Pro.Validate();
// Save the profile.
Pro.SaveToFile("C:\\Profiles\\MyProfile.prx");
}
catch (Exception e)
{
// TODO: Handle exceptions.
}
Requirements
Reference: Windows Media Encoder
Namespace: WMEncoderLib
Assembly: Interop.WMEncoderLib.dll
Library: WMEncoderLib.dll
See Also
.gif)