VBNetCode 類別 風禹科技驗證有限公司 網站 提供 .Net 原始碼

Code 屬性

說明

取得或設定所有程式碼

本函數之引數列表

無引數

傳回值

傳回字串

範例

' 呼叫函數範例
Dim code As New VBNetCode
code.Code = Join(New String() { _
	"Public Function TestFunction(Byval x As Double) As Object", _
	"Return x ^ 2 + 3", _
	"End Function" _
	}, vbNewLine))
MsgBox(Code.Run("TestFunction", 2))

' 呼叫副程式範例
Dim code As New VBNetCode
code.Code = Join(New String() { _
	"Public Sub TestSub(Byval strMessage As String)", _
	"MsgBox(strMessage)", _
	"End Sub" _
	}, vbNewLine)
code.Run("TestSub", "測試")

基本條件

Visual Studio .Net 2005 以後相容版本 | vbCode.vb

請參閱

VBNetCode 類別