public static StationInfo GetStationInfo(IpAndProcess iap, out string msg) { string xml = GetXML("IpAndProcess", new string[] { "IPAddress=" + iap.IPAddress, "ProcessCode=" + iap.ProcessCode }); ServiceAPI ws = new ServiceAPI(); #if ISOFFLINE string returnXml = @"<?xml version='1.0' encoding='utf-8'?> <response> <table> <rows> <Station_Code>B00</Station_Code> <Station_Name>上料工位</Station_Name> </rows> </table> </response>"; #else string returnXml = string.Empty; try { returnXml = ws.Get_StationInfo(xml); } catch (Exception ex) { msg = ex.Message; return(new StationInfo { StationCode = "", StationName = "" }); } #endif return(ConvertXMLtoStation(returnXml, out msg)); }