Asp.net調用DLL文件(如:DecryptActiveX.dll)
1、把dll文件放到bin文件夾下,先引用你的dll文件(右擊bin文件夾—添加引用)
2、using你dll的命名空間 (如:using DecryptActiveX;)
3、在代碼中聲明dll中的類(如:DecryptClass b = new DecryptClass();)
4、接着開始編程(如:string typeid = b.EncryptUrl(MyDs.Tables[0].Rows[0][0].ToString().Trim());)
Asp.net調用DLL控件(如:FredCK.FCKeditorV2.dl)
1、 先引用你的dll文件(右擊bin文件夾—添加引用—瀏覽—選擇要引用的dll文件—確定);
此時bin文件夾中自動添加FredCK.FCKeditorV2.dll和FredCK.FCKeditorV2.dll.refresh兩個文件。
2、 工具箱(右鍵)—選擇項—.NET Framework組件—瀏覽—選擇dll文件—確定;
3、 引入的控件即可出現在工具箱中,直接拖拉就可使用。
在.aspx頁中自動成生代碼,代碼如下:
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<fckeditorv2:fckeditor id="FCKeditor1" runat="server"></fckeditorv2:fckeditor>
在. Web.config頁中自動成生代碼,代碼如下:
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
引用FredCK.FCKeditorV2.dll示例:
http://blog.csdn.net/zhangyj_315/archive/2008/08/20/2802368.aspx