public static bool CheckUser(MESUser user, out string name, out string msg) { name = string.Empty; string xml = GetXML("MESUser", new string[] { "UserNumber=" + user.UserNumber, "UserPwd=" + user.UserPwd, "ProcessCode=" + user.ProcessCode, "StationCode=" + user.StationCode, "MachineNo=" + user.MachineNo }); ServiceAPI ws = new ServiceAPI(); #if ISOFFLINE string returnXml = @"<?xml version='1.0' encoding='utf-8'?> <response> <table> <rows> <returncode>1</returncode> <errormsg>MesUser</errormsg> </rows> </table> </response>"; #else string returnXml = string.Empty; try { returnXml = ws.Check_User(xml); } catch (Exception ex) { msg = ex.Message; return(false); } #endif bool b = CheckXML(returnXml, out name, out msg); if (!string.IsNullOrEmpty(msg)) { LogHelper.WriteError(msg + "xml" + xml); } if (string.IsNullOrEmpty(name)) { name = user.UserNumber; } return(b); }