拿到一套 csharp-mapscript 类库后,经常搞不清楚这套类库的版本。其实 csharp-mapscript 中提供了版本信息察看的方法。非常简单:
mapscript .MS_VERSION ;
mapscript 是 csharp-mapscript 里面的一个对象, MS_VERSION 是它的一个静态方法,不需要定义直接可以调用。
输出 mapscript .MS_VERSION 之后可以看到如下信息:
5.6.1
说明我当前使用的版本是5.4.1 。
同理,还可以通过mapscript 对象来获取很多mapserver 的配置信息。
public class mapscript
{
public static readonly int MAX_ERROR_LEN ;
public static readonly int MESSAGELENGTH ;
public static readonly int MS_AGGERR ;
public static readonly int MS_CGIERR ;
public static readonly int MS_CHILDERR ;
public static readonly int MS_CLASS_ALLOCSIZE ;
public static readonly int MS_DBFERR ;
public static readonly int MS_DEFAULT ;
public static readonly int MS_DEFAULT_LABEL_PRIORITY ;
public static readonly int MS_DELETE ;
public static readonly int MS_EMBED ;
public static readonly int MS_EOFERR ;
public static readonly string MS_ERROR_LANGUAGE ;
public static readonly int MS_FALSE ;
public static readonly int MS_GD_ALPHA ;
public static readonly int MS_GDERR ;
public static readonly int MS_GEOSERR ;
public static readonly int MS_GMLERR ;
public static readonly int MS_HASHERR ;
public static readonly int MS_HASHSIZE ;
public static readonly int MS_HTTPERR ;
public static readonly int MS_IDENTERR ;
public static readonly int MS_IMAGECACHESIZE ;
public static readonly int MS_IMGERR ;
public static readonly int MS_IOERR ;
public static readonly int MS_JOINERR ;
public static readonly int MS_LABEL_BINDING_LENGTH ;
public static readonly int MS_LAYER_ALLOCSIZE ;
public static readonly int MS_MAPCONTEXTERR ;
public static readonly int MS_MAX_CGI_PARAMS ;
public static readonly int MS_MAX_LABEL_PRIORITY ;
public static readonly int MS_MAXPATTERNLENGTH ;
public static readonly int MS_MAXVECTORPOINTS ;
public static readonly int MS_MEMERR ;
public static readonly int MS_MISCERR ;
public static readonly int MS_MULTIPLE ;
public static readonly int MS_NO ;
public static readonly int MS_NOERR ;
public static readonly int MS_NOOVERRIDE ;
public static readonly int MS_NOTFOUND ;
public static readonly int MS_NULLPARENTERR ;
public static readonly int MS_NUMERRORCODES ;
public static readonly int MS_OFF ;
public static readonly int MS_OGLERR ;
public static readonly int MS_OGRERR ;
public static readonly int MS_ON ;
public static readonly int MS_ORACLESPATIALERR ;
public static readonly int MS_OWSERR ;
public static readonly int MS_PARSEERR ;
public static readonly int MS_POSITIONS_LENGTH ;
public static readonly int MS_PROJERR ;
public static readonly int MS_QUERYERR ;
public static readonly int MS_RECTERR ;
public static readonly int MS_REGEXERR ;
public static readonly int MS_SDEERR ;
public static readonly int MS_SHAPEFILE_ARC ;
public static readonly int MS_SHAPEFILE_MULTIPOINT ;
public static readonly int MS_SHAPEFILE_POINT ;
public static readonly int MS_SHAPEFILE_POLYGON ;
public static readonly int MS_SHP_ARCM ;
public static readonly int MS_SHP_ARCZ ;
public static readonly int MS_SHP_MULTIPOINTM ;
public static readonly int MS_SHP_MULTIPOINTZ ;
public static readonly int MS_SHP_POINTM ;
public static readonly int MS_SHP_POINTZ ;
public static readonly int MS_SHP_POLYGONM ;
public static readonly int MS_SHP_POLYGONZ ;
public static readonly int MS_SHPERR ;
public static readonly int MS_SINGLE ;
public static readonly int MS_SOSERR ;
public static readonly int MS_STYLE_ALLOCSIZE ;
public static readonly int MS_STYLE_BINDING_LENGTH ;
public static readonly int MS_SYMBOL_ALLOCSIZE ;
public static readonly int MS_SYMERR ;
public static readonly int MS_TIMEERR ;
public static readonly int MS_TRUE ;
public static readonly int MS_TTFERR ;
public static readonly int MS_TYPEERR ;
public static readonly int MS_UNKNOWN ;
public static readonly string MS_VERSION ;
public static readonly int MS_VERSION_MAJOR ;
public static readonly int MS_VERSION_MINOR ;
public static readonly int MS_VERSION_NUM ;
public static readonly int MS_VERSION_REV ;
public static readonly int MS_WCSERR ;
public static readonly int MS_WEBERR ;
public static readonly int MS_WFSCONNERR ;
public static readonly int MS_WFSERR ;
public static readonly int MS_WMSCONNERR ;
public static readonly int MS_WMSERR ;
public static readonly int MS_YES ;
public static readonly int ROUTINELENGTH ;
public static readonly int SHX_BUFFER_PAGE ;
public mapscript ();
public static void msCleanup ();
public static void msConnPoolCloseUnreferenced ();
public static void msFreeImage (imageObj img );
public static errorObj msGetErrorObj ();
public static string msGetErrorString (string delimiter );
public static string msGetVersion ();
public static int msGetVersionInt ();
public static byte [] msIO_getStdoutBufferBytes ();
public static string msIO_getStdoutBufferString ();
public static void msIO_installStdinFromBuffer ();
public static void msIO_installStdoutToBuffer ();
public static void msIO_resetHandlers ();
public static string msIO_stripStdoutBufferContentType ();
public static mapObj msLoadMapFromString (string buffer , string new_mappath );
public static void msResetErrorList ();
public static int msSaveImage (mapObj map , imageObj img , string filename );
public static int msSetup ();
protected static object ThisOwn_false ();
protected static object ThisOwn_true ();
}