我一直从事ARX开发,VB6.0也用过,现在开始转向.net开发,遇到一个问题就是,VB.net调起cad后为什么msgbox,与messagebox不显示出来了呢?vb6.0用的是Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA"(ByVal hwnd As Integer, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Integer) As Integer
Public Sub DatebaseBackup(ByVal MyDbname As String, ByVal myStr As String)
Dim dbname As String
Dim dbpath As String
Dim Mysqlstr As String
Dim dbuserentername As String
' 备份数据库文件名称:日期和时间信息
dbname = MyDbname & "_BAK" & myStr
'判断文件夹是否存在,若不存在要创建此文件
dbpath = My.Application.Info.DirectoryPath & "\dbbak"
Dim dDir As New IO.DirectoryInfo(dbpath)
If Not dDir.Exists Then
'创建文件夹
System.IO.Directory.CreateDirectory(dbpath)
End If
Mysqlstr = "BACKUP DATABASE " & MyDbname & " TO " & dbname & ""
RunSql(Mysqlstr)
Catch ex As SqlException
Dim errItem As SqlError
Dim errString As String
For Each errItem In ex.Errors
errString += ex.Message + " "
Next
Mysqlstr = "SQL Error.Details follow:" & errString
MsgBox(Mysqlstr, MsgBoxStyle.OkOnly, "金属矿山信息管理系统")
Catch myException As Exception
Mysqlstr = "Exception: " + myException.ToString()
MsgBox(Mysqlstr, MsgBoxStyle.OkOnly, "金属矿山信息管理系统")
End Try
MessageBox.Show("数据库自动备份完毕", "金属矿山信息管理系统", MessageBoxButtons.OK)