Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

TreeNode.treeNodeExport Method

Exports this node and its subtree from the Application Object Tree (AOT).


public void treeNodeExport(str filename, [int flag])

Called

Parameter

Description

filename

The file name for the export file.

flag

If an attacker can control input to this method, a security risk exists. Therefore, this method runs under Code Access Security. Calls to this method on the server require permission from the FileIOPermission Class. Ensure that the user has development privileges by setting the security key to SysDevelopment on the control that calls this method.

This example uses the treeNodeExport method to export the ExampleClass class to an .xpo file.

void TreeNodeExample()
{
    TreeNode treeNode;
    TreeNode childNode;
    FileIoPermission perm;
 
    #define.ExportFile(@"c:\TreeNodeExportExampleClass.xpo")
    #define.ExportMode("w")
    ;
 
    perm = new FileIoPermission(#ExportFile, #ExportMode);
    if (perm == null)
    {
        return;
    }
 
    perm.assert();
 
    treeNode = TreeNode::findNode(@"\Classes");
    if (treeNode != null)
    {
        childNode = treeNode.AOTfindChild(@"ExampleClass");
        // BP deviation documented.
        childNode.treeNodeExport(#ExportFile);
    }
 
    CodeAccessPermission::revertAssert();
}

Community Additions

ADD
Show:
© 2015 Microsoft