IPropertySet接口

本文主要探讨了IPropertySet接口的成员,包括其属性、方法和使用场景,为理解和操作属性集提供了详细信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Members
 Description
Read-only propertyCountThe number of properties contained in the property set.包含属性个数
MethodGetAllPropertiesThe name and value of all the properties in the property set.
MethodGetPropertiesThe values of the specified properties.
MethodGetPropertyThe value of the specified property.
MethodIsEqualTrue if the property set is the same as the input property set.
MethodRemovePropertyRemoves a property from the set.
MethodSetPropertiesThe values of the specified properties.
MethodSetPropertyThe value of the specified property.
public void GetAllProperties (
    ref object names,
    ref object values                      //The name and value of all the properties in the property set.
);


public void GetProperties (
    object names,
    ref object values                       //The values of the specified properties.
);
public object GetProperty (
    string Name                                //The value of the specified property.
);

主要实例是打开Oracle数据库
//Personal Geodatabase e.g., database = "C:\\myData\\mypGDB.mdb"
<span style="font-size:14px;color:#3333ff;">public IWorkspace open_pGDB_Workspace(string database)</span>
<span style="font-size:14px;color:#3333ff;">{</span>
<span style="font-size:14px;color:#3333ff;"><span style="white-space:pre">	</span>ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();</span>
<span style="font-size:14px;color:#3333ff;"><span style="white-space:pre">	</span>propertySet.SetProperty("DATABASE", database);</span>
<span style="font-size:14px;color:#3333ff;"><span style="white-space:pre">	</span>IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactoryClass();</span>
<span style="font-size:14px;color:#3333ff;"><span style="white-space:pre">	</span>return workspaceFactory.Open(propertySet, 0);</span>
<span style="font-size:14px;color:#3333ff;">}</span>
// File Geodatabase e.g., database = "C:\\myData\\myfGDB.gdb"
<span style="color:#3333ff;">public IWorkspace open_fGDB_Workspace(string database)</span>
<span style="color:#3333ff;">{</span>
<span style="color:#3333ff;"><span style="white-space:pre">	</span>ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();</span>
<span style="color:#3333ff;"><span style="white-space:pre">	</span>propertySet.SetProperty("DATABASE", database);</span>
<span style="color:#3333ff;"><span style="white-space:pre">	</span>IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactoryClass();</span>
<span style="color:#3333ff;"><span style="white-space:pre">	</span>return workspaceFactory.Open(propertySet, 0);</span>
<span style="color:#3333ff;">}</span>

//SDE Geodatabase e.g., server = "Kona" // database = "sde" or "" if Oracle // instance = "5151" // user = "vtest" // password = "go" // version = "SDE.DEFAULT" public IWorkspace open_ArcSDE_Workspace(string server, string instance, string user,string password, string database, string version) { ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass(); propertySet.SetProperty("SERVER", server); propertySet.SetProperty("INSTANCE", instance); propertySet.SetProperty("DATABASE", database); propertySet.SetProperty("USER", user); propertySet.SetProperty("PASSWORD", password); propertySet.SetProperty("VERSION", version); IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass(); return workspaceFactory.Open(propertySet, 0); }




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值