下面以发送邮件为例,来简单说明如何使用SQL SERVER调用DLL的功能。第一步:新建一个CS类库 using System; using System.Collections.Generic; using System.Text; using System.Net.Mail; using System.Runtime.InteropServices; namespace BiSoftWare ... { [ComVisible(true)] <--此处为重点,表示此类能对COM类型公开。 public class BiSoftWare ...{ public bool SendMail(string from, string sendToCollection, string ccCollection, string bccCollection, string replyTo,string subject, string body,string smtpSender, string smtpPassWord, string smtpHost) ...{ try ...{ string substr = null; string temp = null; MailMessage message = new MailMessage(); email initializtion#region email initializtion message.From = new MailAddress(from); message.IsBodyHtml = true; message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; message.Priority = MailPriority.Normal; #endregion Assign the message values if they are valid.#region Assign the message values if they are valid. if (!string.IsNullOrEmpty(sendToCollection)) ...{ substr = sendToCollection.Trim(); while (sub