COMAdmin.COMAdminCatalog cat = new COMAdmin.COMAdminCatalog();
COMAdmin.COMAdminCatalogCollection apps = (COMAdmin.COMAdminCatalogCollection) cat.GetCollectionByQuery("Applications",ref ******);
apps.Populate();
foreach (COMAdmin.COMAdminCatalogObject app in apps)
{
if ((string)app.Name == "myapplication")
{
this.listBox1.Items.Add(app.Name);
this.listBox1.Items.Add(app.get_Value("ApplicationProxyServerName"));
if(app.IsPropertyReadOnly("ApplicationProxyServerName")) this.listBox1.Items.Add("readonly");
else this.listBox1.Items.Add("not readonly");
}
app.set_Value("ApplicationProxyServerName",(object)remote_server);
}
apps.SaveChanges();
如果我想找出Applications中名称为myapplication的组件,请问GetCollectionByQuery后一个参数该如何设置?
帮助文档中后一个参数为
GetCollectionByQuery( _
ByVal bstrCollName As String, _
ppsaVarQuery As Variant _
) As Object
我不知道如何构造ppsaVarQuery,请高手给出示例代码,谢谢!:)