Cov txheej txheem:

VBS Tutorial - Cov hauv paus: 5 Kauj Ruam
VBS Tutorial - Cov hauv paus: 5 Kauj Ruam

Video: VBS Tutorial - Cov hauv paus: 5 Kauj Ruam

Video: VBS Tutorial - Cov hauv paus: 5 Kauj Ruam
Video: What happened when I fall #surf #surfing #athlete #waves #surfers #skate #wsl #fit 2024, Kaum ib hlis
Anonim
VBS Tutorial - Cov hauv paus
VBS Tutorial - Cov hauv paus
VBS Tutorial - Cov hauv paus
VBS Tutorial - Cov hauv paus

Ok yog li qee tus neeg tau nug kuv qhov twg kuv tau kawm kuv li vbs los ntawm.. kuv kawm los ntawm ntau lub vev xaib, zoo li w3schools, txawm tias paub tias yog rau lub vev xaib sau ntawv koj tseem tuaj yeem siv nws los ntawm vbs. Kuv kawm nws los ntawm cov vev xaib koj ' ll kawm nws los ntawm kuv = DSo cia pib … vbs yog dab tsi? VBScript yog Microsoft lus sau. -_- yog li Microsoft lawv mus thiab ua kom nws tsuas yog ua haujlwm ntawm IE. Tab sis zoo li yog lub vev xaib nws tau siv rau txhua yam ntawm yam… piv txwv li ntawm daim duab 2) (uas yog daim duab thib ob) Qhov ntawd yog coj los ntawm System 32 nplaub tshev. Vbs kuj tseem tuaj yeem siv los ua cov program.. tab sis qhov ntawd yog VB. NET.. siv feem ntau ntawm cov lej tib yam. Please txaus siab rau kev qhia.. thiab thov tawm tswv yim thiab ntsuas. nyeem.. tab sis kuv nrhiav tsis tau ib qho. Other tshaj li cammel8 uas zoo li zoo heev nrog vbs sau ntawv = P.. tab sis kuv tseem yuav ua tus qhia.

Kauj Ruam 1: Pib ntawm Vbs

Cov hauv paus ntawm Vbs
Cov hauv paus ntawm Vbs
Cov hauv paus ntawm Vbs
Cov hauv paus ntawm Vbs

Yog li ntawm no yog cov hauv paus.. cov khoom koj yuav tsum paub … Koj khaws cov ntaub ntawv raws li: something.vbsIt 's tsis zoo li cov ntaub ntawv batch nws tsis muaj lub vijtsam qhia koj cov ntaub ntawv. Tab sis tib lub sijhawm nws tsis zoo li nws.to ua qhov var koj siv dime.g.. dim iRulenow koj yuav muaj qhov sib txawv hu iRulenow koj tuaj yeem pib ntxiv yam rau koj vars.. zoo li: iRule = msgbox ("nyob zoo") qhov no yuav ua rau lub thawv lus pop tuaj hais nyob zoo. (pic 1) Nrog rau qhov uas koj tuaj yeem ntxiv cov nyees khawm sib txawv rau hauv lub thawv lus.. ntawm no yog txhua yam hais txog lub thawv ntawv: NTAWV Muaj ntau cov lus qhia ntawm lawv tias kuv yuav tsis txawm thab mus rau hauv lawv. Los nrog vars koj tuaj yeem dim vars hauv ib qho array: dim iRule (3) tab sis qhov uas yuav tig tawm zoo li no: (vim 0 suav nrog) iRule (0) = "var1" iRule (1) = "var2" iRule (2) = "var3" iRule (3) = "var4" Siv vars hauv tsab ntawv.. Koj tuaj yeem siv vars yooj yim.. koj tuaj yeem muaj: (pic 2)

dim iRuledim instructablesiRule = "instructables" instructables = msgbox ("nyob zoo" & iRule) Vim hais tias ntawm & nws hais tias 'nyob zoo instructables' vim hais tias tus nqi ntawm iRule yog cov ntawv qhia. tus nqi rov qab. Sub iRule (arg1, arg2, arg3) … Script … Xaus Sub Cov arg 1, 2, 3 yog cov lus sib cav.

Kauj Ruam 2: Tsis Yog Li Hauv paus ntawm Vbs

Tsis Yog Li Hauv paus ntawm Vbs
Tsis Yog Li Hauv paus ntawm Vbs

Kuv yuav pib cov kauj ruam no nrog Kev Ua Haujlwm … vim tias kuv ib txwm pom lawv thab thab.. Txawm tias lawv yooj yim heev = Pfunctions hauv vbs yog yooj yim.. ish.. lawv tuaj yeem ua rau tsis meej pem.. Cia pib nrog ua haujlwm yooj yim: (duab 1)

Lub sijhawm ua haujlwm (x, y) lub sijhawm = x * yEnd FunctionDim resultdim var1result = times (10, 10) var1 = msgbox (qhov tshwm sim) Qhov no yuav ua rau koj 100letlet piav qhia kuv … (10, 10) qhov no mus rau lub sijhawm ua haujlwm x yog tam sim no 10 thiab y tam sim no 10so: x * y rov qab tus nqi nrog cov lus teb. var = 0 txog 5 msgbox (var) nextmsgbox ("Finish") Qhov no yuav nthuav tawm lub thawv ntawv suav 0, 1, 2, 3, 4, 5 tom qab ntawd nws yuav hais tias 'Ua tiav' Nco ntsoov hauv vbs 0 ze li ib txwm suav! qhov chaws yuav rov hais dua 6 zaug piv txwv li: rau var = 0 txog 5 msgbox ("nyob zoo") nextmsgbox ("Finish") cov lus 'nyob zoo' yuav tuaj txog 6 zaug. zaum 7 nws yuav hais Tiav Yog tias koj ntxiv: kauj ruam … mus rau qhov kawg ntawm var = 0 txog 5 piv rau var = 0 txog 5 kauj ruam 5 uas yuav ua rau nws dhia 5 txhua lub sijhawm.. qhov xwm txheej no tsuas yog qhia ob zaug vim 5 yog qhov txwv. Koj tseem tuaj yeem nqis qis ib yam thiab.. piv txwv kauj ruam -5 yuav suav 5 zaug txhua lub sijhawm. Ua, Loopthe ua lub voj yog siv los voj ib daim ntawm cov lej ntau dua thiab ntau dua thiab ntau dua ect. feem ntau yog siv rau cov kab mob = Pbut koj tuaj yeem siv lawv los pab koj.. hais yog tias koj xav khaws cov lus kom txog thaum xaiv qee qhov kev xaiv. Koj tuaj yeem ntxiv ib txog thaum ua lossis ntawm ntu ntu. egdo kom txog thaum var = 5 tab sis hauv tus lej koj yuav tsum ua kom nws ntxiv 1 lossis ntau dua rau qhov hloov.. lossis nws yuav txuas ntxiv mus. Koj tseem tuaj yeem siv ua los ntawm yam xws li: ua thaum var = 10this tsuas yog ua cov lus txib yog yog sib npaug rau 10!

Kauj Ruam 3: Yog Yog thiab Tom Qab

Cov ntawv no tau yooj yim heev kom tau txais tab sis kuv txiav txim siab tias lawv xav tau nplooj ntawv yog tias ib tus neeg tsis paub lawv ua dab tsi, tab sis tiag tiag lawv yooj yim heev: piv txwv li cov ntawv qhia = TheBest ces msgbox ("yog nws yog!") Tab sis qhov ntawd yog tsis nyuaj li peb txhua tus paub tias cov ntawv qhia yog qhov zoo tshaj plaws. = P… tam sim no rau ntau txoj kab ifs thiab thens… (suab paj nruag txaus ntshai) tab sis tsis muaj qhov txaus ntshai koj tsuas yog ntxiv qhov kawg yog thaum kawg ntawm nqe lus. e-g.webp

lwm tus thiab lwm yam Cov no tsis nyuaj ib yam.. lwm qhov tsuas yog rau thaum koj xav tau ib qho kev xaiv rau ib yam thiab lwm yam rau qhov so.. e-g.webp

Kauj ruam 4: Case

rooj plaub yog yooj yim thiab tuaj yeem ua rau koj lub neej yooj yim dua.. piv txwv li ntawm rooj plaub yooj yim:

Dim FavCol FavCol = "red" Xaiv Case FavCol Case "Black" msgbox ("koj Fav Xim yog Dub") Case "red" msgbox ("koj Fav Xim yog Liab") Case "Yellow" msgbox ("koj Fav Xim yog Daj ") Case Elsemsgbox (" Tam sim no koj tsuas yog tsis meej pem ") Xeem Xaiv qhov ntawv yooj yim no yuav xaiv cov npe los ntawm cov npe hauv qhov xwm txheej no nws yuav qhia rau koj tias koj nyiam xim liab.: Dim var, var = "iRule" var tuaj yeem ua dab tsi ntxiv tom qab koj thov vbs los saib los ntawm cov npe kom pom koj cov var … yog tias nws nrhiav tsis tau nws yuav mus rau: Case Else uas zoo ib yam li yog, lwm qhov hais kom ua. yog tias nws pom koj qhov var nws yuav ua

Kauj Ruam 5: Hla Vars

Hla Vars
Hla Vars

Yog tias koj saib ib puag ncig hauv is taws nem koj yuav pom tias muaj coob tus neeg xav paub yuav ua li cas hla vars ntawm pawg mus rau vbs thiab vbs rau ib pawg … Kuv yuav qhia koj txoj hauv kev zoo tshaj plaws uas kuv pom: Txij li qhov no yog vbs qhia kuv ' ll qhia koj yuav ua li cas hloov vars los ntawm vbs mus rau batch ua ntej… VBS TO BATCHQhov no yog vbs:

dim aa = InputBox ("Type in somthing:", "Var") dim WshShellset WshShell = Wscript. Createobject ("Wscript.shell") wshshell.run "test.bat" & a Qhov no yuav nug koj kom ntaus tus ntawv var ces nws yuav hu rau test.bat hla qhov var koj ntaus hauv.a = yam koj tau ntaus rau hauv.here yog pawg: @echo offecho %1pauseexitthis yuav sau qhov var uas koj tau ntaus rau hauv vbs.. Simple … rau ntau yam ntxiv ntxiv: vbs: wshshell.run "test.bat" & a & b & var3 ect.. nco ntsoov teeb tsa lawv cov khoom muaj nuj nqis: ncha %1 %2 %3 ect.. BATCH TO VBSthe batch: @echo offset var = hellowscript test. vbs %var %qhov no yuav xa 'nyob zoo' rau test.vbsthe vbs: dim ArgObj, aSet fso = CreateObject ("Scripting. FileSystemObject") Teeb ArgObj = WScript. Arguments a = ArgObj (0) msgbox (a) qhov no yuav tso tawm ' nyob zoo hauv kab lus. rau ntau lub vars rau pawg rau vbs yooj yim ntxiv lwm qhov piv txwv: pawg wscript test.vbs %var % %var2 %lub vbs: dim ArgObj, a, bSet fso = CreateObject ("Scripting. FileSystemObject ") Teeb ArgObj = WScript. Arguments a = ArgObj (0) b = ArgObj (1) msgb ox (a) msgbox (b) NCO NTSOOV 0 suav Yog tias koj muaj teeb meem nrog cov no thov hu tuaj lossis tawm tswv yim.

Pom zoo: