[英]How to access a dll with c#?
我在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;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.