我正在制作一个Windows窗体。 这是我目前的代码: 我不知道如何将打开文件对话框与我要附加的文件链接起来。
Try
With OpenFileDialog1
'OpenFileDialog1
.Filter = "Text files (*.txt)|*.txt|" & "All files|*.*"
If .ShowDialog() = DialogResult.OK Then
End If
End With
Catch
MsgBox("error occured!")
答案 0 :(得分:2)
类似于......
Dim attach As MailAttachment = New MailAttachment(openFileDialog1.FileName)
Email.Attachments.Add(attach)