private List <DeviceDTO> getOnlineWSDev() { List <DeviceDTO> devices = new List <DeviceDTO>(); var server = bootstrap.GetServerByName(WS_SERVER); if (server == null) { return(devices); } WSServer casicServer = server as WSServer; // CasicSession session = casicServer.GetAllSessions() as CasicSession; foreach (WSSession session in casicServer.GetAllSessions()) { String sessionId = session.SessionID; if (session.MacID != null) { DeviceDTO devDto = new DeviceDTO(); devDto.SessionId = sessionId; devDto.Company = "203所"; devDto.TypeName = "有害气体监测仪"; devDto.Name = session.MacID; devDto.Tag = ""; devDto.Status = "在线"; devDto.ServerName = "WSServer"; devices.Add(devDto); } } return(devices); }