日期:2014-05-16  浏览次数:20944 次

C#获得反射类属性;获取时间段内,选中的星期(可以多个)匹配的天数
获取反射得到类的属性 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
namespace WindowsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Type t = typeof(Form1);
MethodInfo[] info = t.GetMethods();
foreach (MethodInfo i in info)
{
MessageBox.Show(i.Name);
}
}
}
}

   获取时间段内,选中的星期(可以多个)匹配的天数

/// <summary>
/// 时间段内根据查询哪些星期几的所有天数
///