我的代码显然无效,你能帮忙吗?它用于学校项目。
x=msgbox("Hello. Make sure you dispose of this computer properly. You can donate to a local school, retirement home, charitable organization, or a community center. You can recycle it or resell it. Let's protect our enviornment one piece of tech at a time. Our tech. Our future. Our job.",1,"Proper Care")
If vbCancel then
CreateObject("WScript.Shell").Run("http://bestanimations.com/Military/Explosions/earth-explosion-animated-gif-2.gif")
If vbOK then
CreateObject("WScript.Shell").Run("https://www.cta.tech/Consumer-Resources/Greener-Gadgets/Recycle-Electronics.aspx")
x=msgbox("If you don't, we might have a horrible future.",16,"Help the environment")
End If
答案 0 :(得分:0)
If x=vbCancel then CreateObject("WScript.Shell").Run("http://bestanimations.com/Military/Explosions/earth-explosion-animated-gif-2.gif")
If x=vbOK then
CreateObject("WScript.Shell").Run("https://www.cta.tech/Consumer-Resources/Greener-Gadgets/Recycle-Electronics.aspx")
x=msgbox("If you don't, we might have a horrible future.",16,"Help the environment")
End If
答案 1 :(得分:0)
您有两个If
语句,但只有一个End If
语句。我猜你可能希望你的第二个If
实际上是ElseIf
。
另外,说If vbCancel
不符合你的想法。如果您要测试x
的值,则需要测试x
的值。