Asp.net源码专业站
首页->尚未分类->Asp.net在线考试系统源码及毕业设计论文>>Students/WSEndTime.asmx>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Asp.net在线考试系统源码及毕业设计论文
当前文件:文件类型 ExamOnline/Students/WSEndTime.asmx[1K,2009-6-12 11:42:06]打开代码结构图
普通视图
		            
1<%@ WebService Language="C#" Class="ExamOnline.WSEndTime" %> 2 3using System; 4using System.Web; 5using System.Web.Services; 6using System.Web.Services.Protocols; 7using System.Web.Script.Services; 8 9namespace ExamOnline 10{ 11 [WebService(Namespace = "http://tempuri.org/")] 12 [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 13 [ScriptService] 14 public class WSEndTime : System.Web.Services.WebService 15 { 16 [WebMethod] 17 public string getEndTime() 18 { 19 DateTime dt; 20 if(HttpContext.Current.Application["EndTime"] != null) 21 { 22 dt =Convert.ToDateTime(HttpContext.Current.Application["EndTime"]); 23 } 24 else 25 { 26 dt = (new ExamOnline.Exam()).getEndTime(); 27 HttpContext.Current.Application["EndTime"] = dt; 28 } 29 TimeSpan ts = dt - DateTime.Now; 30 31 string hours = ""; 32 string minutes = ""; 33 if(ts.Hours < 10) 34 { 35 hours = "0" + ts.Hours.ToString(); 36 } 37 else 38 { 39 hours = ts.Hours.ToString(); 40 } 41 if (ts.Minutes < 10) 42 { 43 minutes = "0" + ts.Minutes.ToString(); 44 } 45 else 46 { 47 minutes = ts.Minutes.ToString(); 48 } 49 return hours + ":" + minutes; 50 } 51 } 52}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:Asp.net在线考试系统源码及毕业设计论文
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146