using System; using System.Text; using System.Runtime.InteropServices; using PersistentSecurity; //****************************************************************** //* //* This example demonstrates the sgShowServerDetail() function. //* It retrieves information from the license server about all //* components that are checked out and by whom. Plus some other //* interesting information for immediate display purposes. //* //****************************************************************** class ShowDetail { static void Main() { int ret,thread_id=0,sockfd=0,pid=0,count=0; StringBuilder msg = new StringBuilder(1024); StringBuilder ip = new StringBuilder(16); StringBuilder process = new StringBuilder(256); StringBuilder user = new StringBuilder(64); StringBuilder host = new StringBuilder(256); StringBuilder component = new StringBuilder(20); StringBuilder version = new StringBuilder(20); 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.sgShowServerDetail(ref thread_id,ref sockfd, ip,ref pid,process,user,host, component,version,ref count); if (ret == PSProlibProxy.SG_NO_MORE_SERVER_DETAIL) break; Console.WriteLine("({0}), {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}", ret,thread_id,sockfd,ip,pid, process,user,host,component,version,count); } PSProlibProxy.sgDisconnect(); Environment.Exit(0); } }