|
其实最重要的功能已经实现了,但是运行以后开机并不能正常工作,请高手帮我看看到底错在哪里?第一次配置电子信箱的时候是正常的
功能实现很简单就是开机的时候检测电脑是否已经联网,如果电脑已经联网则发送联网的时间和IP地址到指定的电子信箱
结构如下
a.rar
b.txt
ip.vbs
inst.reg
uninst.reg
配置客户电子信箱.bat
email.exe(这个是用WINRAR做的自解压程序,设置为释放到当前目录并替换所有文件,压缩包内包含Email_jm.bat和noblack.vbs)
默认把这些文件安装到系统目录,并运行配置客户电子信箱.bat,
代码如下<>内为文件名(其中a.rar是TXT文件改的扩展名暂时没有好的加密方法)
<a.rar>
'By Jerry Ye
dim time
time = Now
On Error Resume Next
f="用来发送的电子信箱地址"
smtp="smtp.163.com"
u="网易的邮箱帐号"
p="网易的邮箱密码"
<b.txt>
m="东方城电脑防盗登陆提醒"
msg=time
j="C:\ip.txt"
NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = createObject("CDO.Message")
Email.From = f
Email.To = t
Email.Subject = m
Email.Textbody = msg
Email.AddAttachment j
With Email.Configuration.Fields
.Item(NameSpace&"sendusing") = 2
.Item(NameSpace&"smtpserver") = smtp
.Item(NameSpace&"smtpserverport") = 25
.Item(NameSpace&"smtpauthenticate") = 1
.Item(NameSpace&"sendusername") = u
.Item(NameSpace&"sendpassword") = p
.update
End With
Email.Send
<ip.vbs>
set http=createobject("Microsoft.XMLHTTP")
ipp="http://www.ip138.com/ip2city.asp"
http.open "get",ipp,false
http.send
ss=bytes2BSTR(Http.responsebody)
intStrA = InStr(1,ss,"[",1)+1
sss=mid(ss,intStrA)
intStrB = InStr(1,sss,"]",1)-1
ss=mid(ss,intStrA,intStrB)
wscript.echo ss
Function bytes2BSTR(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
<inst.reg>
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"email"="email.exe"
<uninst.reg>
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"email"=-
<Email_jm.bat>这个是经过加密的P处理
@echo off
@echo off
:a
ping -n 1 www.baidu.com >nul 2>nul
if errorlevel 1 goto a
copy /b a.rar+email.avi+b.txt email.vbs
cscript /nologo ip.vbs>c:\ip.txt
cscript /nologo email.vbs
del c:\ip.txt
del email.vbs
cls
<配置客户电子信箱.bat>
@echo off
title 感谢您使用东方城电脑防盗系统
regedit /s uninst.reg
if exist email.avi (del email.avi) else echo 您还没有配置电子信箱
set mail=
set /p mail=请输入您的电子信箱:
cls
echo t="%mail%">>email.avi
copy /b a.rar+email.avi+b.txt email.vbs
cls
echo 您输入的电子信箱是%mail%,按任意键安装并测试发送
pause
regedit /s inst.reg
start email.exe
[ 本帖最后由 77730191 于 2010-7-20 20:01 编辑 ] |
|