日期:2014-05-17 浏览次数:20753 次
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
UserService.AddUser();
}
}
class UserService
{
[My]
public static void AddUser()
{
Console.WriteLine("数据写入到数据库成功!");
}
}
class MyAttribute : System.Attribute
{
public MyAttribute()
{
Console.WriteLine("=============================");
Console.WriteLine("时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
Console.WriteLine("=============================");
}
}
}
static void Main(string[] args)
{
UserService.AddUser();
Type classType = typeof(UserService);
foreach (MethodInfo method in classType.GetMethods())
{