拆解被包裝的物件

  • 1408
  • 0
  • c#
  • 2016-11-24

摘要:拆解被包裝的物件

 

private String GetConten(object e)
{
    String message = String.Empty;
    if (e is Array)
    {
        Array os = e as Array;
        for (int i = 0; i < os.Length; i++)
        {
            message = String.Format("{0} {1}", message, GetConten(os.GetValue(i)));
        }
    }
    else
        message = String.Format("{0} ({1}){2}", message, e.GetType().ToString(), e);
    return message;
}