网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP实例
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.三级下拉框连动的数据库版.
.制作我们自己的Ebay(拍卖系统)(8).
.DW+ASP 玩转动态二级菜单.
.Jmail发信的实例,模块化随时调用.
.最简单的ASP聊天室(附源码).
.利用ASP.NET来访问Excel文档.
.用ASP统计用户在站点的停留时间(.
.使用InstallShield制作ASP安装程.
.ASP+VML+DB实现投票统计项目.
.用ASP+XML打造留言本(1).
.一个新版本的ubb转化程序.
.中文虚拟域名实现(3) (环境:中文.
.filesystemobject组件的用法示例.
.在Web界面下如何生成像资源管理器.
.用ASP开发一个在线考试程序(七).
.用EasyMailObject组件处理Exchan.
.在ASP应用中验证用户身份(4).
.深入讲解 ASP+ 验证(二).
.聊天室自做 Follow Me.
.一个基于ASP的标题广告管理系统(.

功能非常全面的日期处理函数

发表日期:2001-7-11


<script language=javascript>
function fnSubmit(strPage)
{
  document.forms[0].action= strPage
  document.forms[0].submit()    
}

</script>
<%

call writedropdowns

Sub writeDropDowns()
  Dim strSelfLink
  strSelfLink = request.servervariables("SCRIPT_NAME")
  response.Write "<form name=dates method=post>" & vbcrlf
  response.Write MonthDropDown("month1",False,request("month1"),strSelfLink) & " " & DayDropDown("day1", "",getDaysInMonth(request("month1"),request("year1")),request("day1")) & " " & YearDropDown("year1","","", request("year1"),strSelfLink) & vbcrlf
  response.Write "</form>"    & vbcrlf
End Sub
        

Function MonthDropDown(strName, blnNum, strSelected, strSelfLink)
  Dim strTemp, i, strSelectedString            
  strTemp = "<select name='" & strName& "' onchange='javascript: fnSubmit(" & chr(34) & strSelfLink & chr(34) & ")'>" & vbcrlf
  strTemp = strTemp & "<option value='" & 0 & "'>" & "Month" & "</option>" & vbcrlf            
  For i = 1 To 12
    If strSelected = CStr(i) Then
    strSelectedString = "Selected"
    Else
    strSelectedString = ""
    End If
            
    If blnNum Then
      strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf            
    Else
    strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & MonthName(i) & "</option>" & vbcrlf            
    End If
  Next                    
  strTemp = strTemp & "</select>" & vbcrlf    
  MonthDropDown = strTemp
End Function


Function YearDropDown(strName, intStartYear, intEndYear, strSelected, strSelfLink)
  
  Dim strTemp, i, strSelectedString    
  
  If intStartYear = "" Then
    intStartYear = Year(now())
  End If    
    
  If intEndYear = "" Then
    intEndYear = Year(now()) + 9
  End If
    
  strTemp = "<select name='" & strName& "' onchange='javascript: fnSubmit(" & chr(34) & strSelfLink & chr(34) & ")'>" & vbcrlf            
  strTemp = strTemp & "<option value='" & 0 & "'>" & "Year" & "</option>" & vbcrlf            
  For i = intStartYear To intEndYear        
    If strSelected = CStr(i) Then
      strSelectedString = "Selected"
    Else
      strSelectedString = ""
    End If
    strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf                            
   Next                    
   strTemp = strTemp & "</select>" & vbcrlf    
   YearDropDown = strTemp
End Function


Function DayDropDown(strName, intStartDay, intEndDay, strSelected )
    Dim strTemp, i, strSelectedString    
    If intStartDay = "" Then
      intStartDay = 1
    End If    
    
    If intEndDay = "" Then
      intEndDay = getDaysInMonth(Month(now()),Year(now()))
    End If
    
    strTemp = "<select name='" & strName& "'>" & vbcrlf            
    strTemp = strTemp & "<option value='" & 0 & "'>" & "Day" & "</option>" & vbcrlf            
    For i = intStartDay To intEndDay
      If strSelected = CStr(i) Then
        strSelectedString = "Selected"
      Else
        strSelectedString = ""
      End If
      strTemp = strTemp & "<option value='" & i & "' " & strSelectedString & " >" & i & "</option>" & vbcrlf                            
    Next                    
    strTemp = strTemp & "</select>" & vbcrlf    
    DayDropDown = strTemp
End Function


Function getDaysInMonth(strMonth,strYear)
        Dim strDays     
    Select Case CInt(strMonth)
        Case 1,3,5,7,8,10,12:
        strDays = 31
        Case 4,6,9,11:
           strDays = 30
        Case 2:
        If  ( (CInt(strYear) Mod 4 = 0  And  CInt(strYear) Mod 100 <> 0)  Or ( CInt(strYear) Mod 400 = 0) ) Then
          strDays = 29
        Else
          strDays = 28
        End If    
        'Case Else:
    End Select
        
    getDaysInMonth = strDays
End Function    
%>    
上一篇:jmail4.1用pop3收信的例子 人气:10956
下一篇:一个检查E文拼写错误的Code 人气:9689
浏览全部日期的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐