| |
| |
| |
| 文章出处:中国论文下载中心 发布时间:2005-11-11 |
End If
End Function
******************************************************************
Function IsHTML()
此函数判断是不是Html文件
Dim ErrTest
On Error Resume Next
ErrTest = document.Location
If Er Then
IsHTML = False
如果出错,则不是超文本
Else
IsHTML = True
End If
End Function
******************************************************************
Function IsMail(S)
此函数判断是不是邮件地址
Dim m1, m2
IsMail = False
If InStr(S, vbCrLf) = 0 Then
返回vbCrLf在S中第一次出现的位置, vbCrLf是换行符
m1 = InStr(S, "@")
m2 = InStr(S, ".")
If m1 <> 0 And m1 < m2 Then
如果有“@”符号且“@”在“."之前,则是邮件地址
IsMail = True
End If
End If
End Function
******************************************************************
Function Gsf()
得到windows目录
Dim Of, m
On Error Resume Next
Set Of = CreateObject("Scripting.FileSystemObject")
创建FileSystemObject对象
m = Of.GetSpecialFolder(0)
得到特殊目录——Windows、System和Temp目录
If Er Then
如果失败,返回C:
Gsf = "C:"
Else
若正常,则返回%Windows%
Gsf = m
End If
End Function
******************************************************************
Function Lhtml()
写入超文本的内容,其中vbCrLf是换行符
Lhtml = "<" & "HTML" & ">"<" & "Title> Help "<" & "Body> " & Lscript(Lvbs()) & vbCrLf & _
"<" & "/Body>End Function
******************************************************************
Function Lscript(S)
写入vbscript的声明
Lscript = "<" & "script language=VBScript>" & vbCrLf & _
S & "<" & "/script" & ">"
End Function
******************************************************************
Function Sl(S1, S2, n)
Dim l1, l2, l3, i
l1 = Len(S1)
得到文件流的长度
l2 = Len(S2)
得到mailto:的长度
i = InStr(S1, S2)
在文件流中查找mailto:第一次出现的位置——值为一个数
If i > 0 Then
找到则进行字符串爱作
l3 = i + l2 - 1
If n = 0 Then
Sl = Left(S1, i - 1)
ElseIf n = 1 Then
Sl = Right(S1, l1 - l3)
End If
Else
Sl = ""
End If
End Function
******************************************************************
Function Og()
得到WAB(通讯簿)中的邮件地址
Dim i, n, m(), Om, Oo
Set Oo = CreateObject("Outlook.Application")
创建Outlook应用程序对象,Outlook和Outlook Express都跑不掉啦!
|
|
| [返回顶部↑]
|
|
|
| |
|
|
|
|
| |
|