using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
public static void Main()
propClass MyClass = new propClass();
MyClass.service_name = "testTesttestTest";
List<string> myColors = new List<string>{"blue", "green" , "red"};
MyClass.colors = myColors;
Console.WriteLine(CalculateMD5Hash(MyClass.service_name));
public string CalculateMD5Hash(string input)
MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
byte[] hash = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
sb.Append(hash[i].ToString("x2"));
public string service_name { get; set; }
public int code { get; set; }
public decimal version { get; set; }
public List<string> colors { get;set; }
List<string> colors = new List<string>();
public static void PrintProperties(object obj, int indent = 1)
string indentString = new string (' ', indent);
Type objType = obj.GetType ();
PropertyInfo[] properties = objType.GetProperties ();
foreach ( PropertyInfo property in properties )
object propValue = property.GetValue (obj, null);
var elems = propValue as IList;
foreach ( var item in elems )
PrintProperties (item, indent + 3);
if ( property.PropertyType.Assembly == objType.Assembly )
Console.WriteLine("{0}{1}:", indentString, property.Name);
PrintProperties (propValue, indent + 2);
Console.WriteLine("{0}{1}: {2}", indentString, property.Name, propValue);