我在VB中使用了一個使用dll來搜索數據庫的舊應用程序的代碼。你能告訴我怎麼在c#中做到這一點。如何使用c#訪問dll?
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
'Pseek是dll' Pseek是**不是** dll,它的類可能包含在dll中。只要你在你的項目中包含了對dll的引用,就可以在你的項目中使用該類。C#項目 – SysDragon