#include "stdafx.h"
using namespace System;
using namespace System::Security;
using namespace System::Security::Permissions;
using namespace System::Security::Policy;
void main()
{
CodeGroup^ machine;
System::Collections::IEnumerator^ ph = SecurityManager::PolicyHierarchy();
while( ph->MoveNext() )
{
PolicyLevel^ machinePolicyLevel = (PolicyLevel^)ph->Current;
if (machinePolicyLevel->Label == "Machine")
{
machine = machinePolicyLevel->RootCodeGroup;
break;
}
}
SecurityManager::SavePolicy();
}
|