using System; using System.Text; using System.Runtime.InteropServices; using PersistentSecurity; //****************************************************************** //* //* This example demonstrates the sgShowServer() function. //* It retrieves information from the license server about //* components that the server is serving up. //* //****************************************************************** class ShowServer { static void Main() { int ret,count=0,current=0; StringBuilder msg = new StringBuilder(1025); StringBuilder component = new StringBuilder(20); StringBuilder version = new StringBuilder(20); StringBuilder id = new StringBuilder(256); StringBuilder idtype = new StringBuilder(20); StringBuilder expires = new StringBuilder(20); StringBuilder certificate = new StringBuilder(129); PSProlibProxy.sgSetAttrInt(PSProlibProxy.SG_ATTRTYPE.SG_ATTR_LICENSETYPE,(int)PSProlibProxy.SG_LICENSETYPE.SG_LICENSETYPE_FLOATING); ret = PSProlibProxy.sgConnect(); if (ret != PSProlibProxy.SG_SUCCESS) { PSProlibProxy.sgGetLastErrorString(msg); Console.WriteLine("{0}",msg); Environment.Exit(0); } for(;;) { ret = PSProlibProxy.sgShowServer(component,version,id,idtype,ref count,ref current,expires,certificate); if (ret == PSProlibProxy.SG_NO_MORE_SERVER_COMPONENTS) break; Console.WriteLine("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", component,version,id,idtype, count,current,expires,certificate); } PSProlibProxy.sgDisconnect(); Environment.Exit(0); } }