Пример #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0} {1} {2}-->{3} Owner: {4} {5}pkt ({6})",
                            _conn.ToString(),
                            Protocol == Packet.Protocol.TCP ? "TCP" : "UDP",
                            StartTime.ToString("HH:mm:ss.f"),
                            StopTime.ToString("HH:mm:ss.f"),
                            ProcessName,
                            _flows.Count,
                            Conversationflow2.GetFlowTypeName(this.Type)
                            );

            //sb.AppendFormat(" {0} ", Protocol == Packet.Protocol.TCP ? "TCP" : "UDP");
            //sb.AppendFormat("{0} ", StartTime.ToString("HH:mm:ss.f"));
            //sb.AppendFormat("End at {0} ", StopTime.ToString("HH:mm:ss.f"));
            //sb.AppendFormat("Process Name: {0} ", ProcessName);
            //sb.AppendFormat("Total packets: {0} packets ", _pktList.Count);
            //sb.AppendFormat("Total payload: {0} bytes\n", TotalTraffic);
            //sb.AppendFormat("First Packet Size: {0} bytes\n", FPS);
            //sb.AppendFormat("Packet per second: {0:n2} pps\n", PPS);
            //sb.AppendFormat("Average payload length: {0:n2} bytes\n", APL);
            //sb.AppendFormat("Payload Variance : {0:n2} \n", PV);
            return(sb.ToString());
        }
Пример #2
0
        public static Conversationflow2 XmlDeserialize(string xml)
        {
            try
            {
                Conversationflow2 conversationflow = (Conversationflow2)XmlDeserialize(xml);

                return(conversationflow);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Пример #3
0
        public int CompareTo(object obj)
        {
            if (!(obj is Conversationflow2))
            {
                throw new ArgumentException("Object is not an instance of class Flow.");
            }

            Conversationflow2 conversationflow = (Conversationflow2)obj;

            if (conversationflow.ConversationID == this.ConversationID)
            {
                return(0);
            }
            else if (ConversationID > conversationflow.ConversationID)
            {
                return(1);
            }
            else
            {
                return(-1);
            }
        }