vc转换成vb

publicvoidAddAccessDBByName(){IWorkspaceNamepWorkspaceName=newWorkspaceNameClass();pW... public void AddAccessDBByName()
{
IWorkspaceName pWorkspaceName = new WorkspaceNameClass() ;
pWorkspaceName.WorkspaceFactoryProgID = "esriDataSourcesGDB.AccessWorkspaceFactory";
pWorkspaceName.PathName = @"D:\test\Ao\data\sh\MapData.mdb";
IName n = pWorkspaceName as IName ;
IFeatureWorkspace Workspace = n.Open() as IFeatureWorkspace;

IFeatureClass Fcls = Workspace.OpenFeatureClass ("District");
IFeatureLayer Fly = new FeatureLayerClass();
Fly.FeatureClass = Fcls;
MapCtr.Map.AddLayer (Fly);
MapCtr.ActiveView.Refresh();
}
转换成vb代码?? 求高手转换一下!!!
展开
 我来答
棘棘芽
2011-06-07 · TA获得超过563个赞
知道小有建树答主
回答量:608
采纳率:100%
帮助的人:561万
展开全部
public sub AddAccessDBByName()
dim pWorkspaceName as IWorkspaceName
pWorkspaceName =new WorkspaceNameClass()
'--> dim pWorkspaceName as new WorkspaceNameClass
' IWorkspaceName pWorkspaceName = new WorkspaceNameClass() ;

pWorkspaceName.WorkspaceFactoryProgID = "esriDataSourcesGDB.AccessWorkspaceFactory" ';
pWorkspaceName.PathName = "D:\test\Ao\data\sh\MapData.mdb" ';
dim n as IName
n=pWorkspaceName
' IName n = pWorkspaceName as IName ;
'IFeatureWorkspace Workspace = n.Open() as IFeatureWorkspace;
dim Workspace as IFeatureWorkspace
Workspace=n.Open()
dim Fcls as IFeatureClass
Fcls = Workspace.OpenFeatureClass ("District")
'IFeatureClass Fcls = Workspace.OpenFeatureClass ("District");
dim Fly as new FeatureLayerClass
' IFeatureLayer Fly = new FeatureLayerClass();
Fly.FeatureClass = Fcls ';
MapCtr.Map.AddLayer (Fly) ';
MapCtr.ActiveView.Refresh() ';
end sub
应该就是这样的,你用的类我没有用过,语法上就是这样的
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式