您好,登錄后才能下訂單哦!
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
免責(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)容。