先直接用,测试通过后再改为动态函数
If tel1 > tel3 Then
tel2 就没有必要传入函数了
Dim Code As string
Code = "Dim e = args(0)" & vbcrlf
Code = Code & "Dim tel1 As String = args(1)" & vbcrlf
……
Code = Code & "If tel1 " & tel2 & " tel3 Then" & vbcrlf
Code = Code & "If FileSys.FileExists(e) Then"
……
Functions.Add("Sum",Code)
Functions.Complie()
或者像9楼说的那样直接判断把
Dim e = args(0)
Dim tel1 As String = args(1)
Dim tel2 As String = args(2)
Dim tel3 As String = args(3)
Dim tel4 As String = args(4)
If (tel2 = "=" andalso tel1 = tel3) orelse (tel2 = ">" andalso tel1 > tel3) orelse ........ Then
If FileSys.FileExists(e) Then
MessageBox.Show("1")
FileSys.CopyFile(e, tel4 & FileSys.Getname(e),True)
End If
End If