//获取当前系统时间并判断是否为服务时间 TimeSpan nowDt = DateTime.Now.TimeOfDay; TimeSpan workStartDT = DateTime.Parse("10:00").TimeOfDay; TimeSpan workEndDT = DateTime.Parse("15:00").TimeOfDay; if (nowDt > workStartDT && nowDt < workEndDT) {
}