ESRI.ArcGIS.ADF.IMS
Connection Property
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto Namespace > MapService Class : Connection Property




Gets the connection to the ArcIMS Service.

Syntax

Visual Basic (Declaration) 
Public Property Connection As IMSServerConnection
Visual Basic (Usage)Copy Code
Dim instance As MapService
Dim value As IMSServerConnection
 
instance.Connection = value
 
value = instance.Connection
C# 
public IMSServerConnection Connection {get; set;}

Example

This example retrieves the Connection from an existing MapService object and prints the ArcIMS server name and port (this assumes we are using a TCPConnection to the server).
C#Copy Code
ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection conn  

    = (ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection)mapService.Connection; 

lblConnection.Text = "Connection properties:<br>" 

    + "Server: " + conn.Host 

    + "Port: " + conn.AppServerPort; 

    
Visual BasicCopy Code
Dim conn As ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection _

    = CType(mapService.Connection, ESRI.ArcGIS.ADF.Connection.IMS.TCPConnection)

lblConnection.Text = "Connection properties:<br>" _

    + "Server: " + conn.Host _

    + "Port: " + conn.AppServerPort

Remarks

This is the connection used to communicate with the ArcIMS service. The connection is specified when creating the MapService, and is read-only.

The property takes an instance of the abstract class IMSServerConnection. When reading the connection, cast it to the appropriate type of TCPConnection or HTTPConnection in order to read properties specific to the type.

See Also

© 2010 All Rights Reserved.