[英]Passing Attachments from ASP Classic to .Net Email Web Service
My company has a C# .Net based web service for sending email. 我公司有一个基于C#.Net的Web服务,用于发送电子邮件。 This web service does not currently support attachments.
该Web服务当前不支持附件。 We have many old ASP Classic pages that are still using CDONTS for sending emails (including ones with attachments).
我们有许多旧的ASP Classic页面仍在使用CDONTS发送电子邮件(包括带有附件的电子邮件)。 My current task is to find out if we can add attachment support to the web service such that we can replace the ASP Classic CDONTS with calls to the web service.
我当前的任务是确定是否可以向Web服务添加附件支持,以便可以用对Web服务的调用替换ASP Classic CDONTS。 What I'm getting hung up on is this: is it possible to pass those files that need to be attached to the web service from ASP Classic.
我要挂断的是:是否可以从ASP Classic传递那些需要附加到Web服务的文件。
Any help is appreciate: I've found lots of articles describing half of what I need to do, or only approaching it from a .Net-to-.Net angle. 感谢您的帮助:我发现很多文章描述了我需要做的事情的一半,或者仅从.Net到.Net的角度介绍它。
you could use the adodb.stream object to convert binary data into a byte array: 您可以使用adodb.stream对象将二进制数据转换为字节数组:
Function ReadByteArray(strFileName)
Const adTypeBinary = 1
Dim bin : Set bin = Server.CreateObject("ADODB.Stream")
bin.Type = adTypeBinary
bin.Open
bin.LoadFromFile strFileName
ReadByteArray = bin.Read
End Function
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.