3个回答
展开全部
展开全部
'在窗体代码区复制下面代码,并修改提出的问题及答案,然后编译成exe文件。
'首次使用,必须运行一次exe文件。
Option Explicit
Private Sub Form_Load()
Dim strString As String
Dim WSH
Dim strA As String
strString = App.Path & "\" & App.EXEName & ".exe"
Set WSH = CreateObject("WSCRIPT.SHELL")
WSH.Regwrite "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\Test", strString, "REG_SZ"
Set WSH = Nothing
'请修改下面2句
strA = InputBox("请回答下面的问题:" & vbNewLine & "1+1=?", "提问", "2")
If strA <> "2" Then Shell "shutdown -S -t 0" '关机
End Sub
'首次使用,必须运行一次exe文件。
Option Explicit
Private Sub Form_Load()
Dim strString As String
Dim WSH
Dim strA As String
strString = App.Path & "\" & App.EXEName & ".exe"
Set WSH = CreateObject("WSCRIPT.SHELL")
WSH.Regwrite "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\Test", strString, "REG_SZ"
Set WSH = Nothing
'请修改下面2句
strA = InputBox("请回答下面的问题:" & vbNewLine & "1+1=?", "提问", "2")
If strA <> "2" Then Shell "shutdown -S -t 0" '关机
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Private Sub Form_Load()
Dim keyhand As Long
Dim r As Long
strString = App.Path & "\" & App.EXEName & ".exe"
r = RegCreateKey(HKEY_LOCAL_MACHINE,
"software\microsoft\windows\currentversion\run", 工程1.exe)
r = RegSetValueEx(工程1.exe, "jsjuq", 0, REG_SZ, ByVal strString, Len(strString))
r = RegCloseKey(工程1.exe)
dim strA as string
strA=inputbox("请回答下面的问题:" & vbnewline & "1+1=?","提问","2")
if stra<>"2" then Shell "shutdown -S -t 0" '关机
End Sub
未测试,参考!
Dim keyhand As Long
Dim r As Long
strString = App.Path & "\" & App.EXEName & ".exe"
r = RegCreateKey(HKEY_LOCAL_MACHINE,
"software\microsoft\windows\currentversion\run", 工程1.exe)
r = RegSetValueEx(工程1.exe, "jsjuq", 0, REG_SZ, ByVal strString, Len(strString))
r = RegCloseKey(工程1.exe)
dim strA as string
strA=inputbox("请回答下面的问题:" & vbnewline & "1+1=?","提问","2")
if stra<>"2" then Shell "shutdown -S -t 0" '关机
End Sub
未测试,参考!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询