日期:2014-05-17 浏览次数:21143 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Test
{
public int ID { get; set; }
public string Name { get; set; }
public DateTime CreateTime { get; set; }
}
class Program
{
static void Main(string[] args)
{
Test t = new Test() { ID = 1, Name = "abc", CreateTime = DateTime.Now };
var query = t.GetType().GetProperties().Select(x => string.Format("{0}: {1}.", x.Name, x.GetValue(t, null).ToString()));
foreach (string prop in query)
{
Console.WriteLine(prop);
}
}
}
}
public void GetParams()
{
inItem.Clear();
this.GetElementInContainer((Control)HttpContext.Current.Handler, inItem);
}
public void GetParams(Control container)
{
inItem.Clear();
this.GetElementInContainer(container, inItem);
}
private ItemCollection GetElementInCo