本文整理汇总了VB.NET中System.Web.Mail.MailAttachment.MailAttachment构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET MailAttachment构造函数的具体用法?VB.NET MailAttachment怎么用?VB.NET MailAttachment使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了MailAttachment构造函数的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MailMessage
'This example shows how to programmatically add attachments
'to a mail lessage.
Dim MyMail As MailMessage = New MailMessage()
Dim iLoop1 As integer
' Concatenate a list of attachment files in a string.
Dim sAttach As String = "C:\images\image1.jpg,C:\images\image2.jpg,C:\images\image3.jpg"
' Build an IList of mail attachments using the files named in the string.
Dim delim As Char = ","
Dim sSubstr As String
For Each sSubstr in sAttach.Split(delim)
Dim myAttachment As MailAttachment = New MailAttachment(sSubstr)
myMail.Attachments.Add(myAttachment)
Next