.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
相关文档:
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type
Dim lang As String
Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hkey As Long, ByV ......
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,木马的传播等 ......
Private Sub Cmd_OK_Click()
Dim ExcelAppX As Excel.Application
Dim ExcelBookX As Excel.Workbook
Dim ExcelSheetX As Excel.Worksheet
Dim a(1 To 3) As Single
Dim strFormat As Variant
......
从网上搜集到的VB代码,用EXE方式实现了远程注入,不过在反病毒软件的保护下,有可能导致注入失败。转贴这个代码,仅供大家学习和参考。
一、窗口代码:
Option Explicit
Private Sub cmdLock_Click()
If LockKeyboard(True) Then
cmdLock.Enabled = False
cmdUnLock.Enabled = Tr ......