private void protocolTypeReverseIpType() { localdb = new DataClasses1DataContext(streamType.LocalConnString); //using (DataClasses1DataContext localdb = new DataClasses1DataContext(streamType.LocalConnString)) //{ protocolType _protocolType = new protocolType(); //协议取下行包 ip_s var protocol = from p in localdb.IP_stream select new { cpro = p.mmse != null ? "MMSE" : null + p.rtsp_type != null ? "rtsp" : null + p.smtp_type != null ? "smtp" : null + p.bittorrent != null ? "BitTorrent" : null + p.edonkey != null ? "eDonkey" : null + p.oicqVersion != null ? "oicq" : null, p.ip_s }; var protocolL = protocol.Where(e => e.cpro != null).ToLookup(e => e.cpro); foreach (var t in protocolL) foreach (var t1 in t) if (_protocolType.d.ContainsKey(t.Key)) if (!dIP.ContainsKey(t1.ip_s)) dIP.Add(t1.ip_s, _protocolType.ConvertProtocol2trType(t.Key)); //} }