Esempio n. 1
0
 object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null)
     {
         HttpModel http = value as HttpModel;
         string    str  = "IP: FROM " + http.IP_SourceAddress + ":" + http.TCP_SourcePort
                          + "     ------->     TO " + http.IP_DestinationAddress + ":" + http.TCP_DestinationPort;
         return(str.Replace(',', '.'));
     }
     else
     {
         return("");
     }
 }
Esempio n. 2
0
        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                HttpModel http      = value as HttpModel;
                byte[]    byteArray = System.Text.Encoding.Default.GetBytes(http.Content);
                string    str       = Tools.BytesToShowBytes(byteArray);

                if (str.Length > 2000)
                {
                    str = str.Remove(2000, str.Length - 2000);
                }
                return(str);
            }
            else
            {
                return("");
            }
        }