Cov txheej txheem:

Yeej Xa Email Nrog Duab Los Ntawm Batch Cov Ntaub Ntawv Siv Cov Duab Qub thiab XP: 4 Kauj Ruam
Yeej Xa Email Nrog Duab Los Ntawm Batch Cov Ntaub Ntawv Siv Cov Duab Qub thiab XP: 4 Kauj Ruam

Video: Yeej Xa Email Nrog Duab Los Ntawm Batch Cov Ntaub Ntawv Siv Cov Duab Qub thiab XP: 4 Kauj Ruam

Video: Yeej Xa Email Nrog Duab Los Ntawm Batch Cov Ntaub Ntawv Siv Cov Duab Qub thiab XP: 4 Kauj Ruam
Video: Musicians talk about Buckethead 2024, Hlis ntuj nqeg
Anonim
Yeej Xa Email Nrog Duab Los Ntawm Batch Cov Ntaub Ntawv Siv Cov Duab Qub thiab XP
Yeej Xa Email Nrog Duab Los Ntawm Batch Cov Ntaub Ntawv Siv Cov Duab Qub thiab XP

Kuv muaj hmoo heev kom tau pom zoo los ntawm kuv lub qhov rais ua haujlwm hauv tsev. Thaum kuv nyob deb, kuv xav pom qhov kuv ploj lawm thiab kuv nquag nyob deb. Kuv siv muaj kuv tus kheej lub vev xaib thiab chaw nres tsheb huab cua hauv tsev uas yuav tshaj tawm ntawm ftp tag nrho cov ntaub ntawv huab cua thiab daim duab tawm ntawm lub qhov rais, txawm li cas los xij, lub vev xaib tus tswv tsev muab kev saib xyuas lub vev xaib tsis txaus ntseeg, yog li tom qab ntau xyoo, Kuv poob nws. Kuv npaj siab yuav nrhiav txoj hauv kev hloov pauv ntawm kev saib lub qhov rais xws li dawb cov vev xaib, blog, email … Ib qho teeb meem ntxiv yog tias kuv nquag mus ntau lub hlis nyob rau ib lub sijhawm, yog li kev daws teeb meem dab tsi uas tau hais daws yuav tsum ntseeg tau.

Kuv tau txais kev tshoov siab los ntawm Instructables tus sau Olivi3r thiab nws Cov Lus Qhia rau kev tsim lub koob yees duab ruaj ntseg. Tom qab ib hnub los yog li ntawm tes wringing, Kuv tau nws ua haujlwm. Cov Lus Qhia no ntxiv qee qhov ntsiab lus tseem ceeb.

Yeej, lub hom phiaj yog txhawm rau thaij duab nrog lub vev xaib txhua tag kis thiab tom qab ntawd xa daim duab rau kuv tus kheej ntawm gmail raws li qhov txuas. Qhov no yuav tshwm sim raws li hauv qab no:

  • AC fais fab yuav raug qhib rau 15 feeb siv lub sijhawm 110VAC
  • Lub computer yuav qhib
  • Webcam software yuav ntes ib daim duab
  • Lub Windows batch file yuav ua haujlwm uas yuav:
  • Ua tiav PowerShell tsab ntawv sau uas yuav xa email thiab txuas nrog
  • Batch file command yuav kaw lub Computer
  • AC fais fab yuav tua

Ceeb toom: Kuv tsis yog Windows programmer - tsis txhob nug kuv yog tias nws tsis ua haujlwm. Kuv tau txais txoj hauv kev no los ua haujlwm los ntawm snorkeling hauv Is Taws Nem kom txog thaum kuv pom qhov xav tau nkag mus rau hauv kev debugging kuv cov ntaub ntawv. Qhov thib ob, Kuv xav kom qhov no khiav ntawm lub tshuab Windows XP, Kuv paub tseeb tias muaj cov kev daws teeb meem zoo dua ntawm Windows 10 khoos phis tawj. Qhov tseeb, muaj tej zaum cov kev daws teeb meem zoo dua ntawm lub tshuab XP. Yog tias koj pom ib qho, lo lawv hauv cov lus. Khiav txoj hauv kev no ntawm lub khoos phis tawj tuaj yeem yog dicey vim tias lub khoos phis tawj yuav tsum qhib thaum lub zog AC tau qhib. Cov ntawv qhia tus kws qhia muaj tus cwj pwm tsis zoo ntawm kev tso thiab lwm yam cim npe HTML rau hauv cov cai (suav nrog Olivi3r tus lej). Kuv xav tias kuv tau kho txhua qhov ntawm no, tab sis ceev faj.. Thaum kawg, Cov Lus Qhia "Ua Ntej Ua Ntej" khawm tsuas yog muab nplooj ntawv dawb rau kuv - yog li WYSIWYG!

Peb yuav ua qhov no hauv 4 kauj ruam:

  1. Npaj lub computer
  2. Sau thiab debug PowerShell tsab ntawv
  3. Sau thiab debug ib pawg ntawv
  4. Sau tag nrho thiab Bob yog koj tus txiv ntxawm!

Kauj ruam 1: Npaj Computer

Ua ntej, khawb lub desktop qub tawm ntawm lub txee dai khaub ncaws. Yog tias nws tau khiav ntawm Windows XP (SP3) - nws yuav ua haujlwm. Cov Lus Qhia no yog tsim los rau XP tab sis txoj hauv kev yuav tsum zoo ib yam ntawm Windows 10. Tua nws thiab hu rau BIOS (feem ntau yog F1, del lossis F2 thaum lub sijhawm txheej txheem khau raj). Nrhiav qee yam xws li "Kev Tswj Fais Fab" thiab hloov nws mus rau "AC Power Recovery - ON". Qhov no yuav ua rau lub khoos phis tawj qhib thaum lub zog AC qhib. Kuaj nws.

Koj yuav tsum tau lov tes taw txhua tus password thiab kos npe ua tus thawj coj. Qhov no yog vim lub khoos phis tawj yuav tsum ua tiav cov txheej txheem khau raj tsis muaj neeg saib xyuas. Mus rau Tswj Vaj Huam Sib Luag, Tus Neeg Siv Nyiaj thiab hloov qhov tsim nyog yog xav tau.

Tom ntej no, koj xav tau lub vev xaib thiab daim ntawv thov webcam uas yuav thaij duab thiab khaws nws. Kuv siv Dorgem - yooj yim thiab pub dawb. Teeb Dorgem kom thaij duab thiab khaws nws ntawm lub desktop. Tsis txhob hloov lub npe ntawm daim duab thaum thaij duab tshiab, es tsis txhob sau dua daim duab kawg. Hauv qhov piv txwv no daim duab yog Pic.jpg. Tsis tas li, nco ntsoov tias kuv khaws cov duab ntawm lub desktop. Qhov no tseem ceeb vim tias txoj hauv kev yooj yim. Luag thiab poob Dorgem lub cim rau hauv Windows STARTUP nplaub tshev.

Tam sim no - ob peb yam tsis yooj yim:

Koj yuav tsum hloov koj li Chrome account kom tso cai rau cov apps tsis muaj kev nyab xeeb. Goggle "chrome tsawg dua kev nyab xeeb apps" thiab xaiv thawj qhov kev xaiv - tej zaum qhov no. Qhib qhov tshwj xeeb no. Koj yuav tau txais email ceeb toom uas qhia koj txog kev phom sij ntawm qhov chaw no. Koj yuav tsis tas yuav ua qhov no yog tias koj siv email sib txawv server, piv txwv li. Yahoo, AOL…

Tom ntej no koj yuav tsum pab kom ua tiav ntawm PowerShell cov ntawv. Yog tias koj tab tom khiav Windows 10, qhov no yooj yim dua - nyem rau ntawm Windows icon (sab laug sab laug ntawm lub vijtsam), nqes cov npe cov haujlwm rau Windows PowerShell, nthuav dav, nyem rau ntawm PowerShell thiab xaiv "Run as Administrator". Qhov no yuav qhib lub qhov rais PowerShell. Ntawm XP cov txheej txheem nyuaj me ntsis - siv File Explorer, nrhiav PowerShell cov npe (qee yam zoo li C: Windows System32 WindowsPowerShell v1.0), nyem rau ntawm PowerShell icon thiab xaiv "Pin to start menu". Tam sim no koj tau nkag mus rau PowerShell los ntawm txhaj rau lub cim Start (sab laug sab laug) thiab nyem rau ntawm PowerShell icon. Nyem rau ntawm PowerShell icon, hauv lub qhov rai uas tshwm tuaj ntaus cov lus txib hauv qab no:

teeb-ua tiav txoj cai remotesigned

Koj yuav raug hais kom lees paub los ntawm kev ntaus "y".

paub meej tias koj tau hloov pauv txoj cai ua tiav los ntawm kev ntaus:

txoj cai

Ok! Koj lub computer npaj txhij lawm.

Kauj Ruam 2: Sau thiab Debug PowerShell File

Luam thiab muab cov ntawv no tso rau hauv Notepad:

$ EmailTo = "[email protected]"

$ EmailFrom = "[email protected]" $ Subject = "View" $ Body = "x" $ SMTPServer = "smtp.gmail.com" $ SMTPMessage = New-Object System. Net. Mail. MailMessage ($ EmailFrom, $ EmailTo, $ Subject, $ Body) $ attachment = New-Object System. Net. Mail. Attachment ("C: / Documents and Settings / Administrator / Desktop / pic.jpg") $ SMTPMessage. Attachments. Add ($ attachment) $ SMTPClient = New-Object Net. Mail. SmtpClient ($ SmtpServer, 587) $ SMTPClient. EnableSsl = $ True $ SMTPClient. Credentials = New-Object System. Net. NetworkCredential ("userID", "password"); $ SMTPClient. Send ($ SMTPMessage)

Txuag cov ntawv no rau lub desktop ua "SendPic.ps1".

Ua qhov kev hloov pauv tsim nyog rau; koj, userID thiab password. Feem ntau koj tus userID zoo ib yam li koj qhov chaw nyob Gmail tiav.

Yog tias koj tsis siv Gmail, tom qab ntawd koj yuav tsum hauv paus ib puag ncig hauv Is Taws Nem txhawm rau nrhiav qhov chaw nres nkoj cuam tshuam nrog koj lub Smtp server thiab hloov "587" mus rau qhov chaw nres nkoj tsim nyog xws li smtp.mail.yahoo.com thiab chaw nres nkoj yog 465.

Hloov chaw ntawm kev siv Notepad, PowerShell editor muaj.

Tam sim no rau qhov loj - txoj nyem rau ntawm SendPic PowerShell ntawv thiab xaiv "Khiav nrog PowerShell". Yog tias nws ua haujlwm koj yuav tau txais thiab email hauv ob peb feeb. Yog tias nws tsis yog, tom qab ntawd koj yuav tsum pib debugging.

Debugging

Tsim cov ntawv PowerShell tshiab ntawm koj lub desktop hu ua test1 uas xa email tsis muaj ntawv txuas nrog:

$ EmailTo = "[email protected]"

$ EmailFrom = "[email protected]" $ Subject = "test" $ Body = "x" $ SMTPServer = "smtp.gmail.com" $ SMTPMessage = New-Object System. Net. Mail. MailMessage ($ EmailFrom, $ EmailTo, $ Subject, $ Body) $ SMTPClient = New-Object Net. Mail. SmtpClient ($ SmtpServer, 587) $ SMTPClient. EnableSsl = $ True $ SMTPClient. Credentials = New-Object System. Net. NetworkCredential ("userID", "tus password"); $ SMTPClient. Send ($ SMTPMessage)

Qhib cov ntawv nrog PowerShell editor los ntawm txoj nyem rau ntawm cov ntawv thiab xaiv "Kho". Los ntawm kev khiav los ntawm tus kws kho mob, peb tuaj yeem nyeem cov lus yuam kev uas nyem los ntawm thaum koj ob npaug nyem rau ntawm cov ntawv.

cd / desktop

. / test1.ps1

Yog tias qhov no ua tsis tau, tej zaum yog vim muaj teeb meem hauv phau ntawv teev npe. Xyuas kom meej tias PowerShell tau taw qhia rau lub npe desktop. Qhov hais kom ua yuav zoo ib yam li no:

PS C: / Users / koj / Desktop>

Yog tias nws tsis yog, tom qab ntawd koj yuav tsum nco ntsoov txhua yam ntawm koj li qub DOS cov lus txib; cd, dir,. \, thiab lwm yam kom tau PowerShell taw qhia rau lub desktop. Sim nws dua, yog tias nws tsis ua haujlwm, nyeem cov lus yuam kev los pab tshawb pom qhov teeb meem

. / test1

Kauj Ruam 3: Sau thiab Debug Batch File

Qhib Notepad thiab luam cov ntawv hauv qab no:

PING localhost -n 180> NUL

powershell.exe. / SendPic.ps1 kaw -s -t 100

PING nqe lus yog hack tiag tiag uas xa tawm kev thov sib txuas lus txhua thib ob 180 zaug. Kev ncua yuav tsum ntev txaus rau lub khoos phis tawj kom khau raj, tsim kom muaj kev sib txuas hauv Is Taws Nem thiab ntsaws daim duab webcam. Cov kho tshiab ntawm Windows txhawb nqa TIMEOUT - huv dua.

Cov lus tom ntej no ua tiav PowerShell cov ntawv uas xa email nrog daim duab txuas nrog.

Cov lus kawg ua rau lub khoos phis tawj siv hluav taws xob tom qab ncua sijhawm thib 100 thib ob. Lub sijhawm no raug xaiv raws li txaus los xa email.

Txuag cov ntaub ntawv rau koj lub desktop ua SendPic.bat (tsis yog. TXT li yuav tshwm sim yog tias koj tsis ntxiv qhov txuas mus rau lub npe ntaub ntawv. Luag thiab xa cov ntawv mus rau hauv Windows STARTUP nplaub tshev.

Ob npaug nyem rau ntawm lub pob ntawv icon. Koj yuav tsum tau txais email. Whoa! Yooj yim heev. Yog, zoo, ntau tuaj yeem ua tsis raug.

Debugging

Qhov teeb meem nrog debugging ob qho no.bat cov ntaub ntawv thiab yav dhau los.ps1 cov ntaub ntawv yog qhov ua yuam kev nyem los ntawm qhov nrawm dhau los nyeem. Koj tuaj yeem qeeb nws nrog:

PAUSE

PING localhost -n 180> NUL PAUSE powershell.exe. / SendPic.ps1 PAUSE kaw -s -t 100 PAUSE

PAUSE yuav tos koj nias ENTER qhov tseem ceeb. Nyeem cov lus yuam kev. Ntxiv dua thiab, tej zaum yog teeb meem cov npe. Tom qab koj tau kho qhov teeb meem, tshem tawm PAUSE nqe lus, txwv tsis pub txoj haujlwm yuav raug dai.

Yog tias koj xav tshem tawm cov ntawv batch thaum nws ua tiav, nyem rau hauv qhov qhib cmd qhov rai thiab nkag mus ^C (Ctrl C).

Kauj ruam 4: Wrapping Nws Up

Qhwv Nws
Qhwv Nws

Cov desktops qub khiav Windows tsis muaj npe nrov rau lawv qhov kev ntseeg tau. Thawj qhov koj ua thaum koj lub khoos phis tawj ntim khoom yog dab tsi? Tua lub hwj chim! Yog li ntawd yog qhov peb yuav ua. Nrhiav AC Timer Hloov ntawm Walmart lossis Amazon. Qhov pheej yig yog cov khoom siv (tsawg dua $ 10), kim tshaj yog cov khoom siv hluav taws xob (ntau dua $ 20). Ua haujlwm qhov hloov pauv kom qhib rau, piv txwv li, 8 teev sawv ntxov thiab tua 15 feeb tom qab. Txuas koj lub computer mus rau lub qhov hluav taws xob timer.

Thaum lub sijhawm hloov pauv xa lub zog rau koj lub khoos phis tawj cov xwm txheej hauv qab no tau pib:

  1. BIOS pom AC lub zog, lub computer khau raj
  2. Windows pib (tsis muaj tus lej nkag mus)
  3. Webcam program pib thiab snaps daim duab
  4. Batch file tiav pib

    1. Ncua kom ua tiav cov txheej txheem khau raj, thaij duab thiab kos npe hauv Internet
    2. Ua tiav PowerShell ntawv xa email nrog txuas
    3. Ncua kom tiav email
    4. Kaw lub computer

Lub sijhawm hloov pauv yuav tshem lub zog los ntawm lub khoos phis tawj. Qhov no yog qhov tseem ceeb rau kev ua haujlwm tsis muaj neeg saib xyuas. Kuv tau muaj txoj sia nyob tsis tu ncua hard disk ua tsis tiav, program hangups thiab lwm lub khoos phis tawj nres tab sis thaum lub kaw lus tsis ua haujlwm, nws rov qab los tom qab lub zog hloov pauv.

Txoj hauv kev no hloov pauv tau yooj yim rau kev saib xyuas kev nyab xeeb, piv txwv li, siv iSpy txhawm rau txhawm rau kaw cov vis dis aus luv luv thaum lub suab pom thiab xa email nrog daim vis dis aus txuas. Qhov tseeb, lub tswv yim tuaj yeem txuas ntxiv xa email ceeb toom thaum tshawb pom ntawm ib qho xwm txheej twg thiab nrog rau ntxiv rau ntawm Arduino thiab lub cev ntsuas lub cev muaj nyob hauv lub qab ntuj ntawd - lub ntuj txwv!

Pom zoo: