Working with the ArcGIS Server ArcObjects API : ArcObjects API

Working with the ArcGIS Server ArcObjects API


Connecting to a GIS Server

To make use of ArcObjects via ArcGIS Server in your application, you must connect directly to the GIS server, which requires network access to the Server Object Manager (SOM).  

ArcGIS Server Connection objects

You can connect to a GIS Server using the ArcGIS Server library (ESRI.ArcGIS.Server) or the ArcGIS Connection library (ESRI.ArcGIS.ADF.Connection ).


[C#]  for ESRI.ArcGIS.Server
ESRI.ArcGIS.Server.GISServerConnectionClass gisconnection;

gisconnection = new ESRI.ArcGIS.Server.GISServerConnectionClass();

gisconnection.Connect("localhost");

ESRI.ArcGIS.Server.IServerObjectManager som = gisconnection.ServerObjectManager;
[C#] for ESRI.ArcGIS.ADF.Connection

ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity("user", "passwd", "domain");

ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection ags_connection;

agsconnection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection("hostname", identity);

agsconnection.Connect();

IServerObjectManager som = agsconnection.ServerObjectManager;
 
Connecting to the GIS Server: Security
In addition to the Connect method, the IGISServerConnection interface has two properties: 
ServerObjectManager and ServerObjectAdmin. If the application is running as a user in the 
users or administrators group, the application can access the ServerObjectManager property, 
which returns an IServerObjectManager interface. The IServerObjectManager interface provides 
methods for accessing and creating objects within the server for use by applications. 
 
 
 

你可能感兴趣的:(object)