来段代码,楼主看看 差不多就可以结束讨论啦 procedure TFep_ComponentAutoInstall_Frm.SetLocalComputer; var CataColl:TCOMAdminCatalogCollection; CataObj:TCOMAdminCatalogObject; COMADminCata:TCOMAdminCatalog; begin COMADminCata:=TCOMAdminCatalog.Create(Self); try CataColl:=COMADminCata.GetCollection('LocalComputer'); CataColl.Populate; CataObj:=CataColl.Get_Item(0); if (CataObj.Value['DCOMEnabled']=True) and (CataObj.Value['DefaultAuthenticationLevel']=1) and (CataObj.Value['DefaultImpersonationLevel']=3) then MM_InstallInfo.Lines.Add('分布式COM设置不用修改,组件自动安装完成!!!') else begin CataObj.Value['DCOMEnabled']:=True;//分布式COM CataObj.Value['DefaultAuthenticationLevel']:=1;//身份验证级别 CataObj.Value['DefaultImpersonationLevel']:=3;//模拟级别 if CataColl.SaveChanges>0 then MM_InstallInfo.Lines.Add('设置分布式COM成功,请重新启动计算机以便于设置属性生效!!!') else MM_InstallInfo.Lines.Add('设置分布式COM失败,请检查有关属性是否有误!!!'); end; finally COMADminCata.Free; end; end; 里面的说明应该也比较明确了的
差不多就可以结束讨论啦
procedure TFep_ComponentAutoInstall_Frm.SetLocalComputer;
var
CataColl:TCOMAdminCatalogCollection;
CataObj:TCOMAdminCatalogObject;
COMADminCata:TCOMAdminCatalog;
begin
COMADminCata:=TCOMAdminCatalog.Create(Self);
try
CataColl:=COMADminCata.GetCollection('LocalComputer');
CataColl.Populate;
CataObj:=CataColl.Get_Item(0);
if (CataObj.Value['DCOMEnabled']=True) and (CataObj.Value['DefaultAuthenticationLevel']=1) and (CataObj.Value['DefaultImpersonationLevel']=3) then
MM_InstallInfo.Lines.Add('分布式COM设置不用修改,组件自动安装完成!!!')
else
begin
CataObj.Value['DCOMEnabled']:=True;//分布式COM
CataObj.Value['DefaultAuthenticationLevel']:=1;//身份验证级别
CataObj.Value['DefaultImpersonationLevel']:=3;//模拟级别
if CataColl.SaveChanges>0 then
MM_InstallInfo.Lines.Add('设置分布式COM成功,请重新启动计算机以便于设置属性生效!!!')
else
MM_InstallInfo.Lines.Add('设置分布式COM失败,请检查有关属性是否有误!!!');
end;
finally
COMADminCata.Free;
end;
end;
里面的说明应该也比较明确了的