내 이름은 Tony이고 Microsoft 지원 부서의 Distributed Transaction Team에서 일하고 있습니다. 나는 당신의 글을 읽었으며 당신이 원하는 것을 이해하고 있다고 믿습니다. 다음은 구성 요소 수준에서 변경 작업을 수행하기 위해 작성한 코드 샘플입니다. 이 도움이 되었기를 바랍니다.
//Connect to the machine
COMAdmin.COMAdminCatalog m_objAdmin1 = new COMAdmin.COMAdminCatalog();
m_objAdmin1.Connect(System.Environment.MachineName.ToString());
//Get a list of COM+ Applications
COMAdmin.COMAdminCatalogCollection objApplications = (COMAdmin.COMAdminCatalogCollection)m_objAdmin1.GetCollection("Applications");
objApplications.Populate();
COMAdmin.COMAdminCatalogObject appToFind = null;
//Find the application you want to change
for (int i = 0; i < objApplications.Count; i++)
{
appToFind = (COMAdmin.COMAdminCatalogObject)objApplications.get_Item(i);
if (appToFind.Name.ToString() == "MSTEST")
{
break;
}
}
//Now find the component in the application you wish to change
COMAdmin.COMAdminCatalogCollection objComponents = (COMAdmin.COMAdminCatalogCollection)objApplications.GetCollection("Components", appToFind.Key);
objComponents.Populate();
COMAdmin.COMAdminCatalogObject ComponentsToFind = null;
for (int i = 0; i < objComponents.Count; i++)
{
ComponentsToFind = (COMAdmin.COMAdminCatalogObject)objComponents.get_Item(i);
if (ComponentsToFind.Name.ToString() == "tdevere_vb6_com.Tdevere")
{
break;
}
}
//Set the Transaction support option
//Enable the overide option
//Set the new value for the time out option
COMAdmin.COMAdminTransactionOptions temp = (COMAdmin.COMAdminTransactionOptions)ComponentsToFind.get_Value("Transaction");
ComponentsToFind.set_Value("Transaction", COMAdmin.COMAdminTransactionOptions.COMAdminTransactionRequiresNew);
ComponentsToFind.set_Value("ComponentTransactionTimeout", 120);
ComponentsToFind.set_Value("ComponentTransactionTimeoutEnabled", true);
//Make sure to save the changes
objComponents.SaveChanges();
objApplications.SaveChanges();