这是我的功能的一个例子:
Public Class GlobalFunctions
Public Shared Function CreateNewDatabase(ByVal MyDomainName As String, ByVal NewDatabaseName As String, ByVal StatusBoxName As ListBox)
Try
Dim MyWorkingDirectory As String = "C:\mytest1\"
Dim MyFileName As String = "mycmd.exe"
If File.Exists(MyWorkingDirectory & MyFileName) Then
'Run mycmd
'Here are my results
Dim Result1 As String = "r2"
Dim Result2 As String = "r2"
Dim Result3 As String = "r3"
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return True
End Function
End Class
基本上我需要做的是运行我的函数,然后能够在我的下一个函数中使用结果.. 比如:
GlobalFunctions.CreateNewDatabase(DomainName.Text, MyDbName, StatusListBox)
MsgBox(Result1)
MsgBox(Result2)
MsgBox(Result3)
任何帮助将非常感激 ;)