如何使用c#访问dll
本文关键字:dll 访问 何使用 | 更新日期: 2023-09-27 18:29:34
我在VB中有这段代码,来自一个使用dll搜索数据库的旧应用程序。你能告诉我用c#怎么做吗。
Pseek是dll
Dim SeekForm As New PSeek.cSeek
Dim redRow As mscomctl.ListItem
Dim succ As Long
Try
redRow = Nothing
succ = SeekForm.CallSeekForm(My.Settings.PSeekConnectionString, "SELECT id,naziv,adresa,broj,vlez,stan,mesto from vSifrarnik where Firmaid = " & My.Settings.curFirma & " and Siftipid=" & SifTipIDUltraCombo.Value, "id,naziv,adresa,broj,vlez,stan,mesto", redRow, 1, , True, False)
If Not (redRow) Is Nothing Then
SifraIDUltraTextEditor.Text = redRow.Text
SifraIDUltraTextEditor.Focus()
End If
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
添加dll文件,右键单击项目,然后添加引用并选择dll文件。然后在你的代码类型
using LibraryName;