public static string ReadFullProgramPathRunningProgram(ushort handle)
        {
            char[]        buf = new char[256 + 1];
            short         ret = FocasLib.cnc_pdf_rdmain(handle, buf);
            StringBuilder str = new StringBuilder();

            str.Append(buf);
            return(str.ToString().Trim('\0'));
        }
        public static string ReadFullProgramPathRunningProgram(string ipAddress, ushort portNo)
        {
            short  ret            = -20;
            ushort focasLibHandle = 0;

            char[] buf = new char[256 + 1];

            ret = FocasLib.cnc_allclibhndl3(ipAddress, portNo, 10, out focasLibHandle);
            if (ret != 0)
            {
                Logger.WriteErrorLog("cnc_allclibhndl3() failed. return value is = " + ret);
                return(string.Empty);
            }

            ret = FocasLib.cnc_pdf_rdmain(focasLibHandle, buf);
            if (ret != 0)
            {
                return(string.Empty);
            }
            StringBuilder str = new StringBuilder();

            str.Append(buf);
            return(str.ToString().Trim('\0'));
        }