现在我有一个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”入口。请问我应该如何实现呢?
我想把它引入到我的程序中去,可是失败了。应该怎样引用呢? 我在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”入口。请问我应该如何实现呢?
解决方案 »
- 急问windows installer 3.1的主要功能是什么,如果不要有什么影响
- 请问如何获得一个 多维的ArrayList
- 请教下做WINFORM的高手,像QQ这种聊天窗口个人资料的按钮是用的什么控件?
- 打印网格程序开源了,请需要的朋友进来看看,不要让帖子沉下去了
- 怎么在一个aspx中取到另一个aspx中的ctrols
- 弱弱地问:怎样在事件中触发另一个事件?(正在线上等)
- 我的服务器是通过代理服务器出口的,如何取得客户端的真实IP?
- 求助richTextBox+SqlServer的问题[分不够可以再加]
- 数据库连接问题~~~急!
- 关于设置菜单权限的问题
- 这句话对吗?
- 如何将多个文件打包成一个文件?(300分求解)
按照控制台程序编写就行了。
但到了VisualStudio就可以直接调用了。谢谢各位的指教。