Cov txheej txheem:

VBScript Basics - Pib Koj Cov Ntawv, Ncua Sijhawm thiab Ntau Ntxiv!: 5 Kauj Ruam
VBScript Basics - Pib Koj Cov Ntawv, Ncua Sijhawm thiab Ntau Ntxiv!: 5 Kauj Ruam

Video: VBScript Basics - Pib Koj Cov Ntawv, Ncua Sijhawm thiab Ntau Ntxiv!: 5 Kauj Ruam

Video: VBScript Basics - Pib Koj Cov Ntawv, Ncua Sijhawm thiab Ntau Ntxiv!: 5 Kauj Ruam
Video: SUAB HMONG EDITION: Panel discussion with Hmong Medical Assocation host by Neng Xiong 2024, Hlis ntuj nqeg
Anonim
VBScript Basics - Pib Koj Cov Ntawv, Ncua Sijhawm thiab Ntau Ntxiv!
VBScript Basics - Pib Koj Cov Ntawv, Ncua Sijhawm thiab Ntau Ntxiv!

Zoo siab txais tos rau kuv thawj qhov kev qhia yuav ua li cas thiaj ua tau VBScripts nrog notepad. Nrog.vbs cov ntaub ntawv, koj tuaj yeem tsim qee qhov lom zem pranks lossis kab mob tuag taus. Hauv qhov kev qhia no, Kuv yuav qhia koj cov lus txib yooj yim xws li pib koj tsab ntawv, qhib cov ntaub ntawv thiab ntau ntxiv. Thaum kawg, Kuv yuav qhia koj cov ntsiab lus ntawm yam koj tau kawm thiab kuv yuav muab qee lub tswv yim rau koj thiab piv txwv tsab ntawv, thiab qee qhov ntawv sau ntau ntxiv hauv beetween. Cia peb mus rau nws!

Kauj ruam 1: Pib Koj VBScript

Txhawm rau pib, koj yuav tsum tau qhib notepad. Koj tuaj yeem nyem rau ntawm lub desktop, ntawm cov ntawv qhia zaub mov uas tshwm tuaj mus rau qhov tshiab thiab tom qab ntawv sau cov ntawv. Koj tseem tuaj yeem nias lub pob Windows + R thiab ntaus hauv notepad.

Thawj lo lus txib yog siv los tsim cov ntawv zoo nkauj heev. Nov yog cov lus txib:

Teeb WshShell = WScript. CreateObject ("WScript. Shell") Qhov no kuv twv tsim cov ntawv. Nco ntsoov muab lo rau thaum pib ntawm koj li VBS.

Huag, thiab nco ntsoov xaus lub npe ntawm txhua cov ntaub ntawv koj yuav tsim nrog cov lus txib qhia nrog.vbs.

Kauj Ruam 2: Ncua Koj VBS

Hauv qib no, kuv yuav qhia koj cov lus txib yooj yim los pab koj li VBS ua haujlwm kom raug. Qee zaum yam tsis muaj ncua koj tsab ntawv yuav tawg.

Thawj lo lus txib yog WScript.sleep. Koj yuav zoo li siv nws txhua lub sijhawm, nws ncua koj cov ntawv. Nov yog nws ua haujlwm li cas:

WScript.s pw 1000

Thawj ntu ntawm qhov hais kom ua yog qhov tseeb, hais kom ua (wow). Tom qab ntawd, koj muaj lub sijhawm uas yuav raug ncua. Txhua 1000 yog qhov ncaj ncees ntawm ib pliag.

Hauv qhov piv txwv hauv qab no muaj lub thawv ntawv yuav tshwm sim txhua txhua 3 vib nas this tom qab koj ntaus OK ntawm ib qho dhau los.

Kauj Ruam 3: Cov Lus thiab Cov Lus Taw Qhia

Cov Lus thiab Cov Lus Qhia
Cov Lus thiab Cov Lus Qhia

Tam sim no kuv yuav sim qhia koj li cas siv cov lus thiab cov thawv nkag thiab qhov piv txwv me ntsis ADVANCED uas koj tuaj yeem siv koj tus kheej.

Thawj qhov yooj yim tshaj plaws, lub thawv ntawv yooj yim thiab tsis muaj txim. Nov yog qhov piv txwv hais kom ua:

x = msgbox ("Koj cov lus", cov nyees khawm+hom ntawv xa, "Title")

Tom qab koj pib koj cov lus txib tsis txaus ntseeg, koj muaj cov lus, tom qab ntawd khawm, ntaus lub npov lus thiab nws lub npe. Muaj 5 hom sib txawv thiab 4 hom lub npov lus. Nov yog txhua tus ntawm lawv:

0 - OK khawm nkaus xwb 16 - Cov lus tseem ceeb icon1 - OK thiab Ncua tseg 32 - Ceeb toom cov lus nug icon2 - Abort, Rov qab thiab tsis quav ntsej 48 - Ceeb toom cov lus icon3 - Yog, Tsis yog thiab Ncua tseg 64 - Cov lus qhia icon4 - Yog thiab Tsis yog 5 - Rov ua dua thiab thim rov qab

Yog li nrog qhov ntawd, peb cov lus piv txwv yuav yog:

x = msgbox ("Xov", 0+16, "Title")

Tam sim no cov thawv nkag. Cov tsiaj nyaum no muaj qee tus neeg siv cuam tshuam ntau dua (wow), tab sis koj yuav tsis siv lawv ntau zaus (lossis tej zaum…). Nov yog qhov piv txwv:

y = InputBox ("Xov ntawm no", "Title ntawm no", "textbox message")

Pib qhov kev hais kom ua, ntaus cov lus, lub npe thiab cov ntawv xa xov. Yam khoom yooj yim.

Cia peb mus ntxiv me ntsis ntxiv. Tam sim no koj yuav pom lub thawv nkag ua raws los ntawm lub thawv ntawv uas muaj txhua yam koj tau ntaus hauv lub thawv nkag.

Npe = InputBox ("Sau koj lub npe hauv qab no", "Title", "Ntaus koj lub npe ntawm no") x = MsgBox ("Nyob Zoo" & Npe & "!", 16, "Nyob Zoo")

Cov lus hauv qab no nyuab nyuab dua. Ua ntej, koj muaj koj cov lus, tom qab ntawd qee yam koj tau sau ua ntej thiab tom qab ntawv txuas ntxiv. Tab sis tsis muaj dab tsi tawm ntawm qhov dog dig. Kuv xav.

Hauv cov ntawv hauv qab no koj tuaj yeem pom txhua lub thawv sib txawv thiab ib lub thawv nkag.

Kauj ruam 4: Qhib.exe Cov Ntaub Ntawv

Nrog VBScripts koj tseem tuaj yeem qhib.exe cov ntaub ntawv. Nov yog qhov piv txwv hais kom ua uas qhib lub laij lej:

WshShell.run "calc.exe"

Thaum pib koj muaj lus txib, thaum kawg koj muaj qhov program koj xav qhib. Tsis ntau los piav.

Cov ntaub ntawv hauv qab no yuav qhib lub laij lej, pleev xim thiab CMD.

Kauj ruam 5: Cov ntsiab lus

Hauv qhov kev qhia no koj tau kawm paub pib koj li ntawv.vbs, ncua nws, siv cov lus thiab cov thawv nkag, qhib.exe cov ntaub ntawv thiab xaus koj tsab ntawv. Tam sim no, cia mus vwm nrog qhov no. Kuv yuav tsim qhov tsis raug tab sis txaus ntshai prank rau troll koj cov phooj ywg.

Qhov piv txwv prank nug koj lub npe, qhia koj tias nws tsis yog lub tswv yim zoo thiab qhib zoo li CMD zoo li 30 zaug Kuv vam tias koj nyiam nyeem qhov no. Qhov no puas yog qhov ruam tshaj plaws? Koj puas tau kawm qee yam tshiab? Tsis pub dawb los qhia rau kuv hauv cov lus.

Pom zoo: