现在我有一个API程序IdealCopy.exe,估计是用VS2005开发出来的。
我想把它引入到我的程序中去,可是失败了。应该怎样引用呢? 我在VS.net 2003中尝试自动引用,结果提示说不是有效的DLL库或COM组件。IdealCopy的定义如下:
Namespace ConsoleApplication1
      Friend Class Program
            ' Methods
            Public Sub New()
            Private Shared Sub code(ByVal v As UInt32(), ByVal k As UInt32())
            Private Shared Function ConvertStringToUInt(ByVal Input As String) As UInt32
            Private Shared Function ConvertUIntToString(ByVal Input As UInt32) As String
            Private Shared Sub decode(ByVal v As UInt32(), ByVal k As UInt32())
            Private Shared Function Decrypt(ByVal Data As String, ByVal Key As String) As String
            Private Shared Function Encrypt(ByVal Data As String, ByVal Key As String) As String
            Private Shared Function FormatKey(ByVal Key As String) As UInt32()
            Public Shared Function IdealCopy(ByVal args As String()) As Integer
            Public Shared Function IdealCopyCos(ByVal args As String()) As Boolean
            Public Shared Function IdealCopyPos(ByVal args As String()) As Boolean
            Public Shared Sub Main(ByVal args As String())            ' Properties
            Public Shared Property objWriter As StreamWriter            ' Fields
            Private Shared objwriter As StreamWriter
      End Class
End Namespace
Public Shared Function IdealCopy(ByVal args As String()) As Integer
      Dim num1 As Integer = 0
      If Program.IdealCopyCos(args) Then
            num1 += 1
      End If
      If ((num1 > 0) AndAlso Program.IdealCopyPos(args)) Then
            num1 += 1
      End If
      Return num1
End Function我需要做的是获取IdealCopy的返回值。我的调用方式如下:
<DllImport("IdealCopy.exe", _
                EntryPoint:="ConsoleApplication1.Program.IdealCopy")> _
    Public Shared Function IdealCopy(ByVal args As String()) As Int32    End FunctionDim arg As String() = {orderID, DNS, errorLog, Login, Password}
        MessageBox.Show(IdealCopy(arg))但实际运行时却提示无法找到“ConsoleApplication1.Program.IdealCopy”入口。请问我应该如何实现呢?