在VB.NET下生成库函数
为什么我的VB代码不能生成库函数呢运行的时候有提示说
a project with an output type of class library cannot be started directly
in order to debug this project add an excutable project to this solution which references the library project.set the excutable project as the startup project.
这是我的代码
Imports System.Math
Public Class Class1
Public Const Pi As Double = 3.14159265358979
'===================
'Single Liquid Phase
'===================
'[A1-1] PI
Public Function Function11122_Darcy(ByVal input() As Double) As Double(,)
Dim k, h, re, Bo, muo, rw, s As Double
k = input(0)
h = input(1)
re = input(2)
Bo = input(3)
muo = input(4)
rw = input(5)
s = input(6)
If rw >= re Then
MsgBox("Input Error: Wellbore radius [rw] should be less than external bounday radius [re].", MsgBoxStyle.OkOnly)
Dim temp(5, 1) As Double
temp(0, 0) = -1234.56789
Return temp
End If
Dim Jo(5, 1), i, j As Double
For i = 0 To 5
For j = 0 To 1
Jo(i, j) = -9999
Next
Next
Jo(0, 0) = k * h / (141.2 * Bo * muo * (Log(re / rw) + s))
Function11122_Darcy = Jo
End Function
End Class --------------------编程问答-------------------- 你生成的是一个DLL文件,当然不能单独运行了,要想调试,再建一个EXE工程,调用你的DLL。 --------------------编程问答-------------------- 新建 项目 类库。。。或者控件库。。。
再点运行,在项目的BIN文件夹下就有一个与项目同名的DLL文件
补充:.NET技术 , VB.NET