- 浏览: 417751 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (174)
- ajax (2)
- java (4)
- spring (0)
- eclipse (0)
- ejb (0)
- hibernate (2)
- jsf (1)
- c# (13)
- sqlserver (12)
- oracle (1)
- ibatis (3)
- appfuse (0)
- seam (0)
- log4j (0)
- Java2Html (0)
- javascript && html && css (38)
- 英语学习 (1)
- jag (2)
- guice (0)
- warp (0)
- facelets (1)
- struts (0)
- 资源汇聚 (4)
- 打印 (2)
- 热点文章收藏 (2)
- aop/aop.net (3)
- 代码生成器 (1)
- 数据库 (1)
- 开发工具集 (1)
- Erlang (1)
- web services (1)
- acegi (2)
- 存储过程集汇 (1)
- 黑客攻防 (2)
- C/C++ (6)
- wap (1)
- 缓存 分布式 (0)
- 企业库 (3)
- 搜索引擎:Lucene (0)
- 数据安全 (1)
- uml (1)
- 项目管理 (3)
- asp (1)
- SWT/JFACE (3)
- 面试与技巧 (1)
- 程序人生 (1)
- java rcp (2)
- 软件测试 (4)
- 不同应用服务器整合 (1)
- 数据仓库 (2)
- 求职/离职 (1)
- 网站珍藏 (1)
- visual studio 插件 (2)
- IT那些事 (1)
- linux/unix (10)
- windows (1)
- javaMail (1)
- common mail (1)
- tomcat (1)
- java并发/并行 (3)
- emacs (5)
- zookeeper (1)
- hadoop (7)
- 自动运维部署 (8)
- 业界资讯 (1)
最新评论
-
ffshow2006:
有一个有毒啊
两款Access密码破解器 -
nicepulse:
太好了,正好最近我也遇到这类的问题,代理不大正常,刚开始就是重 ...
SQL Server Agent 执行SSIS失败解决方案 -
supersnake:
这个比较喜欢
5款纯div+css制作的弹出菜单(标准且无js) -
cloudgamer:
我也写过一个提示效果
javascript tooltip (网页的提示效果) -
kuchaguangjie:
顶1个,哈哈
获取页面请求参数的JS脚本
获取有效工作日封装类
http://www.sina.com.cn 2008年06月25日 16:36 IT168.com
<!----><!----><!---->
【IT168技术文档】
在做项目的时候要求得到该月的有效工作日,于是开始写静态方法,后来由于还要获取当月开始到现在的有效工作日,于是再写方法,最后因为以后的项目还要用于是继续扩展,直接封装出一个类来。
【IT168技术文档】
在做项目的时候要求得到该月的有效工作日,于是开始写静态方法,后来由于还要获取当月开始到现在的有效工作日,于是再写方法,最后因为以后的项目还要用于是继续扩展,直接封装出一个类来。
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
using System.Text;
namespace MyCom.Util.Time
{
/// <summary>
/// 获取有效工作日
/// </summary>
public class WorkDateProvider
{
#region 静态方法段
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, int intNoContain)
{
//判断不包含天数是否合法
if (intNoContain <= 0)
throw (new Exception("不包含天数必须大于0"));
return GetWorkDateBy2Date(dt1, dt2) - intNoContain;
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, int intNoContain, int intContain)
{
if (intContain <= 0)
throw (new Exception("包含天数必须大于0"));
return GetWorkDateBy2Date(dt1, dt2, intNoContain) + intContain;
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, string[] strarrNoContain, string[] strarrContain)
{
int intContain = 0;
foreach (string strContain in strarrContain)
{
try
{
DateTime dtDuring = DateTime.Parse(strContain);
if (dt1 <= dtDuring && dtDuring <= dt2)
switch (dtDuring.DayOfWeek) //判断是否本来不是工作日的日期
{
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
intContain++;
break;
default:
break;
}
}
catch (Exception ex)
{
throw (ex);
}
}
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain) + intContain;
}
{
/// <summary>
/// 获取有效工作日
/// </summary>
public class WorkDateProvider
{
#region 静态方法段
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, int intNoContain)
{
//判断不包含天数是否合法
if (intNoContain <= 0)
throw (new Exception("不包含天数必须大于0"));
return GetWorkDateBy2Date(dt1, dt2) - intNoContain;
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, int intNoContain, int intContain)
{
if (intContain <= 0)
throw (new Exception("包含天数必须大于0"));
return GetWorkDateBy2Date(dt1, dt2, intNoContain) + intContain;
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, string[] strarrNoContain, string[] strarrContain)
{
int intContain = 0;
foreach (string strContain in strarrContain)
{
try
{
DateTime dtDuring = DateTime.Parse(strContain);
if (dt1 <= dtDuring && dtDuring <= dt2)
switch (dtDuring.DayOfWeek) //判断是否本来不是工作日的日期
{
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
intContain++;
break;
default:
break;
}
}
catch (Exception ex)
{
throw (ex);
}
}
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain) + intContain;
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, string[] strarrNoContain)
{
int intNotContain = 0;
foreach (string strNoContain in strarrNoContain)
{
try
{
DateTime dtDuring = DateTime.Parse(strNoContain);
if (dt1 <= dtDuring && dtDuring <= dt2)
{
switch (dtDuring.DayOfWeek)//判断原来是工作日
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intNotContain++;
break;
default:
break;
}
}
}
catch (Exception ex)
{
throw (ex);
}
}
return GetWorkDateBy2Date(dt1, dt2, intNotContain);
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2)
{
if (dt1 > dt2)
throw (new Exception("开始日期必须大于结束日期"));
int intTotalDays = 0;
for (DateTime dtDuring = dt1; dtDuring <= dt2; dtDuring = dtDuring.AddDays(1))
{
switch (dtDuring.DayOfWeek)//判断是否为工作日
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intTotalDays++;
break;
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
break;
}
}
return intTotalDays;
}
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2, string[] strarrNoContain)
{
int intNotContain = 0;
foreach (string strNoContain in strarrNoContain)
{
try
{
DateTime dtDuring = DateTime.Parse(strNoContain);
if (dt1 <= dtDuring && dtDuring <= dt2)
{
switch (dtDuring.DayOfWeek)//判断原来是工作日
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intNotContain++;
break;
default:
break;
}
}
}
catch (Exception ex)
{
throw (ex);
}
}
return GetWorkDateBy2Date(dt1, dt2, intNotContain);
}
/// <summary>
/// 在一段内获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateBy2Date(DateTime dt1, DateTime dt2)
{
if (dt1 > dt2)
throw (new Exception("开始日期必须大于结束日期"));
int intTotalDays = 0;
for (DateTime dtDuring = dt1; dtDuring <= dt2; dtDuring = dtDuring.AddDays(1))
{
switch (dtDuring.DayOfWeek)//判断是否为工作日
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intTotalDays++;
break;
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
break;
}
}
return intTotalDays;
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, int intNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, int intNoContain, int intContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain, intContain);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, string[] strarrNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, string[] strarrNoContain, string[] strarrContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain, strarrContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, int intNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, int intNoContain, int intContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain, intContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, string[] strarrNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, string[] strarrNoContain, string[] strarrContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain, strarrContain);
}
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, int intNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, int intNoContain, int intContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain, intContain);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, string[] strarrNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain);
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthAndYear(int intMonth, int intYear, string[] strarrNoContain, string[] strarrContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", intYear, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", intYear, intMonth, System.DateTime.DaysInMonth(intYear, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain, strarrContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, int intNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, int intNoContain, int intContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain, intContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, string[] strarrNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain);
}
/// <summary>
/// 获取本年制定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByMonthThisYear(int intMonth, string[] strarrNoContain, string[] strarrContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, intMonth));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, intMonth, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, intMonth)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain, strarrContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear()
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(int intNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(int intNoContain, int intContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain, intContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(string[] strarrNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(string[] strarrNoContain, string[] strarrContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain, strarrContain);
}
#endregion
#region 内部变量
protected int _WorkDateYear = DateTime.Now.Year;
protected int _WorkDateMonth = DateTime.Now.Month;
protected string[] _NoContainDays = null;
protected string[] _ContainDays = null;
protected DateTime _WorkDateStart = DateTime.Now;
protected DateTime _WorkDateEnd = DateTime.Now;
protected GetDaysType _GetDaysType = GetDaysType.ByMonthAndYear;
#endregion
#region 属性
/// <summary>
/// 制定年份
/// </summary>
public int WorkDateYear
{
set
{
_WorkDateYear = value;
}
get
{
return _WorkDateYear;
}
}
/// <summary>
/// 制定月份
/// </summary>
public int WorkDateMonth
{
set
{
_WorkDateMonth = value;
}
get
{
return _WorkDateMonth;
}
}
/// <summary>
/// 不包含日期
/// </summary>
public string[] NoContainDays
{
set
{
_NoContainDays = value;
}
get
{
return _NoContainDays;
}
}
/// <summary>
/// 包含日期
/// </summary>
public string[] ContainDays
{
set
{
_ContainDays = value;
}
get
{
return _ContainDays;
}
}
/// 获取本年本月的有效工作日
/// </summary>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear()
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="intNoContain">不包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(int intNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="intNoContain">不包含日期数</param>
/// <param name="intContain">包含日期数</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(int intNoContain, int intContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, intNoContain, intContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(string[] strarrNoContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain);
}
/// <summary>
/// 获取本年本月的有效工作日
/// </summary>
/// <param name="strarrNoContain">不包含日期列表</param>
/// <param name="strarrContain">包含日期列表</param>
/// <returns>有效工作日数</returns>
public static int GetWorkDateByThisMonthThisYear(string[] strarrNoContain, string[] strarrContain)
{
DateTime dt1 = DateTime.Parse(string.Format("{0}-{1}-01", DateTime.Now.Date.Year, DateTime.Now.Date.Month));
DateTime dt2 = DateTime.Parse(string.Format("{0}-{1}-{2}", DateTime.Now.Date.Year, DateTime.Now.Date.Month, System.DateTime.DaysInMonth(DateTime.Now.Date.Year, DateTime.Now.Date.Month)));
return GetWorkDateBy2Date(dt1, dt2, strarrNoContain, strarrContain);
}
#endregion
#region 内部变量
protected int _WorkDateYear = DateTime.Now.Year;
protected int _WorkDateMonth = DateTime.Now.Month;
protected string[] _NoContainDays = null;
protected string[] _ContainDays = null;
protected DateTime _WorkDateStart = DateTime.Now;
protected DateTime _WorkDateEnd = DateTime.Now;
protected GetDaysType _GetDaysType = GetDaysType.ByMonthAndYear;
#endregion
#region 属性
/// <summary>
/// 制定年份
/// </summary>
public int WorkDateYear
{
set
{
_WorkDateYear = value;
}
get
{
return _WorkDateYear;
}
}
/// <summary>
/// 制定月份
/// </summary>
public int WorkDateMonth
{
set
{
_WorkDateMonth = value;
}
get
{
return _WorkDateMonth;
}
}
/// <summary>
/// 不包含日期
/// </summary>
public string[] NoContainDays
{
set
{
_NoContainDays = value;
}
get
{
return _NoContainDays;
}
}
/// <summary>
/// 包含日期
/// </summary>
public string[] ContainDays
{
set
{
_ContainDays = value;
}
get
{
return _ContainDays;
}
}
/// <summary>
/// 开始日期
/// </summary>
public DateTime WorkDateStart
{
set
{
_WorkDateStart = value;
}
get
{
return _WorkDateStart;
}
}
/// <summary>
/// 结束日期
/// </summary>
public DateTime WorkDateEnd
{
set
{
_WorkDateEnd = value;
}
get
{
return _WorkDateEnd;
}
}
/// <summary>
/// 获取工作日类型
/// </summary>
public GetDaysType EmunGetDaysType
{
set
{
_GetDaysType = value;
}
get
{
return _GetDaysType;
}
}
#endregion
#region 调用枚举
/// <summary>
/// 获取工作日类型枚举
/// </summary>
public enum GetDaysType
{
ByDateStartAndEnd,
ByMonthAndYear
}
#endregion
#region 实例构造函数
/// <summary>
/// 默认本年本月获取有效工作日
/// </summary>
public WorkDateProvider()
{
EmunGetDaysType = GetDaysType.ByMonthAndYear;
}
/// <summary>
/// 设定开始日期和结束日期获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
public WorkDateProvider(DateTime dt1, DateTime dt2)
{
WorkDateStart = dt1;
WorkDateEnd = dt2;
EmunGetDaysType = GetDaysType.ByDateStartAndEnd;
}
/// <summary>
/// 设定本年指定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
public WorkDateProvider(int intMonth)
{
WorkDateMonth = intMonth;
EmunGetDaysType = GetDaysType.ByMonthAndYear;
}
/// <summary>
/// 设定指定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
public WorkDateProvider(int intMonth, int intYear)
{
WorkDateMonth = intMonth;
WorkDateYear = intYear;
EmunGetDaysType = GetDaysType.ByMonthAndYear;
}
#endregion
#region 实例方法段
/// <summary>
/// 获取有效时间
/// </summary>
/// <returns>有效工作日数</returns>
public int GetWorkDays()
{
return GetWorkDays(EmunGetDaysType);
}
/// <summary>
/// 获取有效时间
/// </summary>
/// <param name="getDaysType">获取时间类型</param>
/// <returns>有效工作日数</returns>
public int GetWorkDays(GetDaysType getDaysType)
{
if (getDaysType == GetDaysType.ByDateStartAndEnd)
return GetWorkDayByDateStartAndEnd();
else
return GetWorkDayByYearAndMonth();
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <returns>有效工作日数</returns>
private int GetWorkDayByYearAndMonth()
{
WorkDateStart = DateTime.Parse(string.Format("{0}-{1}-01", WorkDateYear, WorkDateMonth));
WorkDateEnd = DateTime.Parse(string.Format("{0}-{1}-{2}", WorkDateYear, WorkDateMonth, DateTime.DaysInMonth(WorkDateYear, WorkDateMonth)));
return GetWorkDayByDateStartAndEnd();
}
/// 开始日期
/// </summary>
public DateTime WorkDateStart
{
set
{
_WorkDateStart = value;
}
get
{
return _WorkDateStart;
}
}
/// <summary>
/// 结束日期
/// </summary>
public DateTime WorkDateEnd
{
set
{
_WorkDateEnd = value;
}
get
{
return _WorkDateEnd;
}
}
/// <summary>
/// 获取工作日类型
/// </summary>
public GetDaysType EmunGetDaysType
{
set
{
_GetDaysType = value;
}
get
{
return _GetDaysType;
}
}
#endregion
#region 调用枚举
/// <summary>
/// 获取工作日类型枚举
/// </summary>
public enum GetDaysType
{
ByDateStartAndEnd,
ByMonthAndYear
}
#endregion
#region 实例构造函数
/// <summary>
/// 默认本年本月获取有效工作日
/// </summary>
public WorkDateProvider()
{
EmunGetDaysType = GetDaysType.ByMonthAndYear;
}
/// <summary>
/// 设定开始日期和结束日期获取有效工作日
/// </summary>
/// <param name="dt1">开始日期</param>
/// <param name="dt2">结束日期</param>
public WorkDateProvider(DateTime dt1, DateTime dt2)
{
WorkDateStart = dt1;
WorkDateEnd = dt2;
EmunGetDaysType = GetDaysType.ByDateStartAndEnd;
}
/// <summary>
/// 设定本年指定月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
public WorkDateProvider(int intMonth)
{
WorkDateMonth = intMonth;
EmunGetDaysType = GetDaysType.ByMonthAndYear;
}
/// <summary>
/// 设定指定年月的有效工作日
/// </summary>
/// <param name="intMonth">月份</param>
/// <param name="intYear">年份</param>
public WorkDateProvider(int intMonth, int intYear)
{
WorkDateMonth = intMonth;
WorkDateYear = intYear;
EmunGetDaysType = GetDaysType.ByMonthAndYear;
}
#endregion
#region 实例方法段
/// <summary>
/// 获取有效时间
/// </summary>
/// <returns>有效工作日数</returns>
public int GetWorkDays()
{
return GetWorkDays(EmunGetDaysType);
}
/// <summary>
/// 获取有效时间
/// </summary>
/// <param name="getDaysType">获取时间类型</param>
/// <returns>有效工作日数</returns>
public int GetWorkDays(GetDaysType getDaysType)
{
if (getDaysType == GetDaysType.ByDateStartAndEnd)
return GetWorkDayByDateStartAndEnd();
else
return GetWorkDayByYearAndMonth();
}
/// <summary>
/// 获取制定年月的有效工作日
/// </summary>
/// <returns>有效工作日数</returns>
private int GetWorkDayByYearAndMonth()
{
WorkDateStart = DateTime.Parse(string.Format("{0}-{1}-01", WorkDateYear, WorkDateMonth));
WorkDateEnd = DateTime.Parse(string.Format("{0}-{1}-{2}", WorkDateYear, WorkDateMonth, DateTime.DaysInMonth(WorkDateYear, WorkDateMonth)));
return GetWorkDayByDateStartAndEnd();
}
/// <summary>
/// 获取开始日期到结束日期之间的有效工作日
/// </summary>
/// <returns>有效工作日数</returns>
protected int GetWorkDayByDateStartAndEnd()
{
//判断时间有效性
if (WorkDateStart > WorkDateEnd)
throw (new Exception("开始日期大于结束日期"));
int intNoContainDays = 0;
int intContainDays = 0;
int intTotalDays = 0;
//计算不包含日期数
if (NoContainDays != null)
foreach (string strNoContain in NoContainDays)
{
DateTime dtDuring = DateTime.Parse(strNoContain);
if (WorkDateStart <= dtDuring && dtDuring <= WorkDateEnd)
{
switch (dtDuring.DayOfWeek)
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intNoContainDays++;
break;
default:
break;
}
}
}
//计算包含日期数
if (ContainDays != null)
foreach (string strContain in ContainDays)
{
DateTime dtDuring = DateTime.Parse(strContain);
if (WorkDateStart <= dtDuring && dtDuring <= WorkDateEnd)
{
switch (dtDuring.DayOfWeek)
{
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
intContainDays++;
break;
default:
break;
}
}
}
//计算常规日期数
for (DateTime dtDuring = WorkDateStart; dtDuring <= WorkDateEnd; dtDuring = dtDuring.AddDays(1))
{
switch (dtDuring.DayOfWeek)
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intTotalDays++;
break;
default:
break;
}
}
return intTotalDays - intNoContainDays + intContainDays;
}
#endregion
}
}
/// 获取开始日期到结束日期之间的有效工作日
/// </summary>
/// <returns>有效工作日数</returns>
protected int GetWorkDayByDateStartAndEnd()
{
//判断时间有效性
if (WorkDateStart > WorkDateEnd)
throw (new Exception("开始日期大于结束日期"));
int intNoContainDays = 0;
int intContainDays = 0;
int intTotalDays = 0;
//计算不包含日期数
if (NoContainDays != null)
foreach (string strNoContain in NoContainDays)
{
DateTime dtDuring = DateTime.Parse(strNoContain);
if (WorkDateStart <= dtDuring && dtDuring <= WorkDateEnd)
{
switch (dtDuring.DayOfWeek)
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intNoContainDays++;
break;
default:
break;
}
}
}
//计算包含日期数
if (ContainDays != null)
foreach (string strContain in ContainDays)
{
DateTime dtDuring = DateTime.Parse(strContain);
if (WorkDateStart <= dtDuring && dtDuring <= WorkDateEnd)
{
switch (dtDuring.DayOfWeek)
{
case DayOfWeek.Saturday:
case DayOfWeek.Sunday:
intContainDays++;
break;
default:
break;
}
}
}
//计算常规日期数
for (DateTime dtDuring = WorkDateStart; dtDuring <= WorkDateEnd; dtDuring = dtDuring.AddDays(1))
{
switch (dtDuring.DayOfWeek)
{
case DayOfWeek.Monday:
case DayOfWeek.Tuesday:
case DayOfWeek.Wednesday:
case DayOfWeek.Thursday:
case DayOfWeek.Friday:
intTotalDays++;
break;
default:
break;
}
}
return intTotalDays - intNoContainDays + intContainDays;
}
#endregion
}
}
发表评论
-
asp.net的DropDownList通用绑定代码
2008-06-25 14:55 2542asp.net的DropDownList通用绑定代码 作者: ... -
获取 asp.net 控件的所有子控件
2008-06-12 09:27 2481获取 asp.net 控件的所有子控件 ... -
在web.config中配置控件,以适应所有页面
2008-06-10 11:35 1227在web.config中配置控件,以适应所有页面 如下,是ma ... -
asp.net to html
2008-06-08 09:53 880WebRequest mywebReq ; W ... -
.NET Tools
2008-05-12 12:40 1183Here are listed some of the e ... -
.NET 开发框架技术资料搜集
2008-05-06 13:36 3694.NET 开发框架技术资料 ... -
.NET开源项目
2008-05-05 13:25 1975.Net General 微软.Net中文主页 .NET ... -
代码生成器集合(整理)
2008-05-05 13:22 34741:CodeSmith 一款人 ... -
C#开源资源大汇总
2008-05-04 14:18 7038C#开源资源大汇总 2008年 ... -
ASP.NET下载文件(弹出打开保存文件对话框)
2008-04-16 18:45 13949ASP.NET下载文件(弹出打开保存文件对话框) //file ... -
Asp.net 2.0 用FileUpload 控件实现多文件上传
2008-04-15 17:40 4572Asp.net 2.0 用FileUpload 控件 ... -
VS.net 2005快捷键一览表
2008-03-24 10:53 1755VS.net 2005快捷键一览表 全局”快捷键 下列快捷组合 ...
相关推荐
这个工具类可能已经封装了这些复杂逻辑,使得开发者能快速得到高度信息,简化了布局工作。 然后,"获取今天的日期:年月日"涉及到了日期和时间的处理。在iOS中,我们可以使用`Date`对象和`Calendar`类来获取当前...
在IT领域,网络时间协议(Network ...通过理解NTP协议的工作原理以及客户端类的设计和实现,开发者可以有效地创建自己的NTP客户端,从而确保网络中的时间一致性,这对于许多分布式系统和时间敏感的应用程序至关重要。
同时,系统会监测所选时间的有效性,比如检查是否超出当前时间,或者是否符合工作日和工作时间的规定,以确保日志记录的准确性。 为了实现这些功能,开发者可能使用了如ASP.NET、Java EE等服务器端技术来构建后端...
10. **处理业务逻辑中的日期时间**:比如工作日计算、节假日判断等。 `DateTimeHelper.java`的源码分析可以帮助我们更好地理解如何使用这些功能,以及如何优化日期时间处理的代码。源码中可能使用了上述的一些或...
基于构件的软件开发技术是软件危机问题日益突出形势下的产物,它有效地解决了软件系统复杂度、成本、质量、效率等难以控制的问题。当前主流的软件构件技术有三大流派,分别是 OMG 的 CORBA、SUN 的 EJB 和微软的 ...
在源码中,我们可以看到Delphi的面向对象特性被充分利用,通过自定义的类结构,封装了代理服务器的获取、验证、管理等过程。其中,"TProxyGet"类很可能是主控件类,包含了获取代理、处理代理列表、验证代理有效性的...
本实验报告涵盖了几个关键的网络概念和技术,包括常用网络命令的使用、以太网帧的封装以及交换机的工作原理。 首先,实验一关注的是常用网络命令的掌握。这些命令对于网络管理员来说是日常工作的基础工具,例如: 1...
- 使用封装类实现网络通信模块的功能,包括`IPAddress`类处理套接字地址,异常处理类管理Socket异常,以及网络通信类提供TCP、多线程和多路复用等功能。 - 下载并集成IPv6支持补丁,主要包括`tpipv6.h`和`wspiapi....
尽管可能将一个点表示为类,但结构在某些方案中更有效。在一些情况下,结构的成本较低。例如,如果声明一个含有 1000 个点对象的数组,则将为引用每个对象分配附加的内存。结构可以声明构造函数,但它们必须带参数。...
招标文件的获取时间为2007年10月23日至2007年11月9日,工作日在绍兴市招投标中心指定地点购买,每套招标文件售价100元,且不退。报名时需提供企业法人营业执照原件及复印件、报名表、报名人身份证原件及复印件,以及...
3. 组合类:`Time`类表示时间,包含年、月、日三个整型变量,是`Telem`类的一个组成部分,体现了类的组合特性。 4. 虚基类和派生类:`People`类作为虚基类,拥有`Teacher`和`worker`两个派生类,这是面向对象中的...
9. **反射机制**:Java反射机制允许程序在运行时动态地获取类的信息并调用其方法,是许多框架和工具(如Spring)的基础。 10. **Java虚拟机(JVM)**:了解JVM的工作原理,包括类加载、内存管理(堆、栈、方法区等...
在对日IT项目中,经常会遇到许多专业术语,这些词汇是进行有效沟通和技术实施的关键。以下是一些重要的技术概念和词汇的详细解释: 1. **オラクル(Oracle)**:Oracle是一家全球知名的数据库管理系统供应商,提供...
Date类是处理日期的常见数据结构,它可能包含构造函数、析构函数、比较操作符(如==、<)、获取和设置日期组件(年、月、日)的方法等。测试代码会涵盖这些功能的不同组合,以确保日期操作的正确性。 3. **...
- 另外,还可以结合`DateTime`对象,通过比较和计算来实现特定日期的逻辑处理,如判断是否是工作日、节假日等。 4. **源码分析** - 压缩包中的“实例039 使用日历表”源码可能包含一个简单的C# Windows Forms应用...
这些类提供了丰富的API,如获取年月日、时分秒、比较日期等。比如,`LocalDateTime.now()`可以获取当前日期时间,`LocalDateTime.parse("2022-03-15T10:30")`可以从字符串解析出日期时间。 在"Date Util"中,可能...
例如,将时间显示的逻辑封装到单独的函数或类中,使用清晰的变量名,编写注释来解释代码的工作方式,这些都是提高代码质量的有效手段。 综上所述,"最简单时间显示"这个主题涵盖了许多编程和软件设计的基本概念,从...
该类接收一个`DateTime`类型的参数,并利用`ChineseLunisolarCalendar`类的实例`cc`来获取农历的年、月、日及是否为闰月的信息。 - `GetYear()`, `GetMonth()`, 和 `GetDayOfMonth()` 方法分别用于获取农历的年份、...
- Class类:获取类的信息,如构造器、方法、字段等。 - 动态调用:使用Class对象创建对象,调用方法,设置和获取字段值。 9. **网络编程** - Socket编程:TCP和UDP通信的基本概念和实现。 - URL和URLConnection...