1, in the development environment, in the vs.net2003 or 2005 of the IDE environment can implement the automatic registration of COM components, set as follows: Project name-> "Properties"-> Configuration Properties-> build-> Select "Register for COM Interop," Compile.
2, with a strong name of the way
(1), create Strong name
Sn–k mycom.snk
and copy the strong name to the engineering directory.
Modify the corresponding configuration in Assembyinfo.cs
[Assembly:assemblykeyfile (@ "Http://www.cnblogs.com/mycom.snk")]
[Assembly:comvisible (True)]
(2), Registered Accessories
RegAsm Mycom.dll/tlb:mycom.tlb
(3), will install accessories into the GAC
Gacutil-i Mycom.dll
3, without the strong name of the way
RegAsm Mycom.dll/tlb:mycom.tlb/codebase
Note the use of codebase, if you want to register a. NET assembly without a strong name, then use the RegAsm registration will be added/codebase, which is to set the basic code in the registry, that is, record the path of the DLL.
After registration, create objects and use the same method as above:
Set mydll = Server.CreateObject ("Mycom.object")
Mydll.method
If you call the encryption decryption tool in OA4, the ASP tutorial code is as follows:
<%
Dim Objencrytool
Dim strtemp
Set objencrytool = Server.CreateObject ("Routdata.devbase.basetools.encrytool")
strtemp = "Abc-jian"
Response.Write strtemp & "<br>"
strtemp = Objencrytool.en (strtemp)
Response.Write strtemp & "<br>"
strtemp = objencrytool.de (strtemp)
Response.Write strtemp & "<br>"
Set Objencrytool = Nothing
%>
Note that the class method to be published cannot be static
Assembly Registration Tool (Regasm.exe)
Http://msdn.microsoft.com/library/chs/default.asp?url=/library/chs/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp
Strong Name Tool (Sn.exe)
Http://msdn.microsoft.com/library/chs/default.asp?url=/library/chs/cptools/html/cpgrfassemblyregistrationtoolregasmexe.asp