Sunteți pe pagina 1din 9

Prueba 3.

vbs

MsgBox "Mensaje Sencillo"

MsgBox "Advertencia", 5

MsgBox "Informacion" ,266304

texto = "GG"

MyBox = MsgBox (texto,266304, "Tu cuenta ha sido hackeada")

Ciclo.vbs

Dim x

x=1

Do While x<=5

MsgBox("Welcome.")

x=x+1

Loop

Space.vbs

Dim txt

txt=Space(100)

msgbox"/"& txt & "/"

AbrirCalculadora.vbs

Set ObjShell = CreateObject ("WScript.Shell")

objShell.Run "Calc.exe"
variables.vbs

Dim variable1,variable2,variable3

variable1="ELSA"

variable2 ="YAYIN"

MsgBox variable1

MsgBox variable2

variable3 ="Z"

MsgBox variable3

Ciclo2.vbs

Dim nombre,length

nombre= InputBox ("Ingresa tu nombre perro")

length = Len(nombre)

document.write lenght

MensajeDeBienvenida.vbs

Sub mensajedesalida()
MsgBox("Welcome")

End sub

Call mensajedesalida 'Llamar método

Comprar.vbs

string1=InputBox ("Ingresa tu nombre")

string2=InputBox ("Ingresa tu nombre otra vez")

msgbox(StrComp(string1,string2))

PruebaHTML.vbs

<html>

<head>

<title>Mi primer codigo VBSCRIPT</title>

</head>

<body>
<script type ="text/vbscript">

document.write("SI !!!!" ESTOY APRENDIENDO VBSCRIPT")

</body>

</html>

Vocales.vbs

Dim nombre,length

nombre= InputBox ("Ingresa tu nombre perro")

length = Len(nombre)

For i = 1 to length

txt = Mid(nombre,i,1)

If txt= "a" or txt= "A" or txt = "e" or txt= "E" or txt = "i" or txt="I" or txt= "o" or txt= "O" or txt= "u" or
txt= "U" THEN

counter = counter+1

End If

Next

MsgBox ("Hola " & nombre & " tu nombre contiene " & counter & " vocales" )
String.vbs

Dim txt

txt = InputBox("Escribe tu nombre")

msgbox(StrReverse(txt))

AreaCirculo.vbs

Function findArea (radius)

const pi=3.14

area = pi*radius*radius

findArea = area

End function

radius= InputBox("Escribe el radio de tu circulo")

MsgBox("El area de tu circulo cuando el radio es " & radius & " es de " & findArea(radius) & " ")

ValidandoEdad2.vbs

Dim day, today

day = Date()

today = DatePart ("w", day)

If today=1 Then

MsgBox("Today is Sunday")

ElseIf today=2 Then


MsgBox("Today is Monday")

ElseIf today=3 Then

MsgBox("Today is Tuesday")

ElseIf today=4 Then

MsgBox("Today is Wednesday")

ElseIf today=5 Then

MsgBox("Today is Thursday")

ElseIf today=6 Then

MsgBox("Today is Friday")

ElseIf today=7 Then

MsgBox("Today is Saturday")

End IF

Mensaje.vbs

MsgBox ("Hello World")

Fecha.vbs

Dim day, today

day = Date()

today = DatePart ("w", day)

If today=1 Then

MsgBox("Today is Sunday")

ElseIf today=2 Then


MsgBox("Today is Monday")

ElseIf today=3 Then

MsgBox("Today is Tuesday")

ElseIf today=4 Then

MsgBox("Today is Wednesday")

ElseIf today=5 Then

MsgBox("Today is Thursday")

ElseIf today=6 Then

MsgBox("Today is Friday")

ElseIf today=7 Then

MsgBox("Today is Saturday")

End IF

Nombres.vbs

Dim arrNombres (4)

Dim contador

arrNombres(0)="Dayanne"

arrNombres(1)="Roberto"

arrNombres(4)="Gerardo"

arrNombres(2)="Bladimir"

arrNombres(3)="Edson"

'Llamar ciclo DoLoop

CicloDoLoop
CicloWhile

Sub CiclodoLoop

MsgBox "Iniciando Ciclo DoLoop"

contador=0

Do

MsgBox arrNombres(contador)

contador= contador + 1

Loop until contador = uBound(arrNombres) + 1

End Sub

Sub CicloWhile

MsgBox "Inciando Ciclo While"

contador =0

while contador <= uBound(arrNombres)

MsgBox arrNombres(contador)

contador= contador + 1

wend

End Sub

ForNext

ForEachNext

Sub ForNext

MsgBox " Ciclo ForNext avanzando dos lugares "


for contador=0 to uBound(arrNombres) step 2

MsgBox arrNombres(contador)

next

End Sub

Sub ForEachNext

MsgBox " Ciclo ForEachNext"

Dim element

For each element in arrNombres

msgBox element

next

End sub

Manipulacion.vbs

string1 = "one two three four one two three four one two three four"

resultado = replace (string1, "two","six",8)

msgbox resultado

S-ar putea să vă placă și