public static int ToInt(this object anObject) { int ret = 0; try { ret = Convert.ToInt32(anObject); } catch (Exception) { } return ret; }