心理罪片尾曲好恐怖:谁能给一个vb的小程序?急!!!
来源:百度文库 编辑:中科新闻网 时间:2024/09/21 06:46:44
多谢童生给的答案,可惜太难了啊!谁能给个简单点的啊!谢了啊!
其实vb即使什么代码都不写也算完整程序.
我的qq:404127503
以下是一个判断vb是否运行于编译环境:
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Private Sub Form_Load()
'Set the command button names
Command1.Caption = "应用程序名称"
Command2.Caption = "应用程序的运行模式"
End Sub
Private Sub Command1_Click()
'Click this button if the project name and the compiled file
'name are different.
MsgBox VB.App.EXEName
End Sub
Private Sub Command2_Click()
'Click this button if the project name and the compiled file
'name are the same.
Dim strFileName As String
Dim lngCount As Long
strFileName = String(255, 0)
lngCount = GetModuleFileName(App.hInstance, strFileName, 255)
strFileName = Left(strFileName, lngCount)
'不同的VB版本不同,如果是VB5就要换成VB5.EXE
MsgBox strFileName
If UCase(Right(strFileName, 7)) <> "VB6.EXE" Then
MsgBox "Compiled Version"
Else
MsgBox "IDE Version"
End If
End Sub