.net中用DropDownList选择日期(vb代码)
看了别人写的C#的 自己转了一下 然后后重新改了改 写成了这个
另外还有一个我写的验证日期是否合法的代码 在后面 都是vb的 c#只会看不会写
'判断闰年=======================
Private Function CheckLeap(ByVal year As Integer) As Boolean
If (year Mod 4 = 0) AndAlso (year Mod 100 <> 0) OrElse (year Mod 400 = 0) Then
Return True
Else
Return False
End If
End Function
'判断闰年结束=======================
'绑定每月的天数=====================
Private Sub BindDays(ByVal year As Integer, ByVal month As Integer)
Dim i As Integer
Dim AlDay As New ArrayList()
Select Case month
Case 1, 3, 5, 7, 8, 10, 12
For i = 1 To 31
AlDay.Add(i)
Next
'Exit Select
Case 2
If CheckLeap(year) Then
For i = 1 To 29
AlDay.Add(i)
Next
Else
For i = 1 To 28
AlDay.Add(i)
Next
End If
'Exit Select
Case 4, 6, 9, 11
For i = 1 To 30
AlDay.Add(i)
Next
'Exit Select
End Select
DropDownList_day.DataSource = AlDay
DropDownList_day.DataBind()
End Sub
'绑定每月的天数结束=====================
'页面上拖三个DropDownList DropDownList_year DropDownList_month DropDownList_day 都要autopostback
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim AlYear As New ArrayList()
Dim i As Integer
For i = 1940 To 1992
AlYear.Add(i)
Next
Dim AlMonth As New ArrayList
For i = 1 To 12
AlMonth.Add(i)
Next
If Not Me.IsPostBack Th
相关文档:
Option Explicit
Private Sub Form_Load()
'工程->引用->选中Microsoft ActiveX Data Objects 2.8 Library
Dim shujukulianjie As New ADODB.Connection
Dim jiluji As New ADODB.Recordset
'连接数据库的代码段
shujukulianjie.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Sour ......
http://www.webuc.net/ddf3/archive/2005/08/25/6142.aspx
不用FSO的复制文件夹得方法?
用API函数 SHFileOperation
以下是使用SHFileOperation删除复制移动文件的例子,可以复制文件夹
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pfrom As String
pTo As String
fFlags As ......
一 木马的由来
木马,即“特洛伊木马”(trojan horse)。
二 所需要的技术
一个成功的木马,除了制作出相关的程序以外,还需要实现以下几方面的功能。1,木马的隐藏 2,木马的运行 3,木马的复制 4,木马的传播等 ......
'读数据到二进制字段
Public Sub ReadfromBLOB(filed As ADODB.Field, Filen As String)
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer
'传送块单位大小
Const ChunkSize As Integer = 16384
Dim MediaTemp As String
Dim lngOffset As Long
Di ......