我找了一个VBS文件的源代码。能该成C#代码么?

来源:百度知道 编辑:UC知道 时间:2024/05/26 16:46:54
on error resume next
dim WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")
WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""请在弹出的对话框中输入‘我是猪’并且点确定,否则我帮你关机,目前倒计时60秒,有种就别说"" ",0 ,true
dim a
do while(a <> "我是猪")
a = inputbox ("说我是猪,就不关机,快撒,说 ""我是猪"" ","www.hackstudy.cn"," 请输入“我是猪”并且点确定,终止关机倒计时",8000,7000)
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
loop
msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true
msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾"

我只学了点JAVA和C#
不太能看的懂VB的代码
能带成C#代码么?

貌似是有个C# 转VB的工具,用VB太少,不记得工具叫什么

给你个链接看看
http://dev.csdn.net/article/43/43256.shtm

晕,我这就有一个这个代码,不过我把它改成了输入我是帅哥,不然就关机