利用vbs脚本远程telnet执行远程主机程序

‘建立Shell对象
set sh=WScript.CreateObject("WScript.Shell")
WScript.Sleep 1000
‘启动telnet,注意要保证telnet.exe程序所在的路径如c:\winnt\system32在path环境变量中
sh.Run  "telnet.exe"
WScript.Sleep 1000
‘向telnet发送我们平时录入的命令
sh.SendKeys "open 192.168.10.120"
WScript.Slee[……]

继续阅读

VB 随机生成10个 1-100之间的数。求10数的和

Private Sub Command1_Click()
Dim a(1 To 10) As Integer
Dim i As Integer
Dim sum As Integer, strpj As Integer
For i = 1 To 10
suiji = Int(100 * Rnd + 1)
Print suiji
a(i) = suiji
sum = sum + a(i)
Next i
Print ,
Text1.Text = sum
End Sub

[……]

继续阅读

VB编写,输入身份证号,输出年月日

Private Sub Command1_Click()
Dim nian, yue, ri As Integer
Dim sfzh As String
sfzh = Text1.Text
nian = Mid(sfzh, 7, 4)
yue = Mid(sfzh, 11, 2)
riri = Mid(sfzh, 13, 2)

[……]

继续阅读

VB成的 计算周长和面积

Private Sub Command1_Click()
Dim a, b, mj, zhch As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
If a = 0 Or b = 0 Then
MsgBox "你见过没有长或宽的矩形吗", vbOKOnly, "提示"
Else
zhch = (a + b) * 2
Text4.Text = zhch
mj = a * b
Text3.Text =[……]

继续阅读

VB写的简单登陆框

 

Private Sub Command1_Click()
Dim name, mima As Single
name = Text1.Text
mima = Val(Text2.Text)

If name = "abc" And mima = 123456 Then

MsgBox "登陆成功", vbOKOnly, "恭喜你。。"
Else

MsgBox "登录失败", vbOKOnly, "提示"
Text1.SetFocus

End If

E[……]

继续阅读

第 1 页,共 1 页1