Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetContentFromFile() [1/2]

void System.Net.Mail.AttachmentBase.SetContentFromFile ( string fileName,
ContentType contentType )
inlinepackageinherited

Definition at line 154 of file AttachmentBase.cs.

155 {
156 if (fileName == null)
157 {
158 throw new ArgumentNullException("fileName");
159 }
160 if (fileName.Length == 0)
161 {
162 throw new ArgumentException(System.SR.Format(System.SR.net_emptystringcall, "fileName"), "fileName");
163 }
164 Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read);
165 _part.SetContent(stream, contentType);
166 }
void SetContent(Stream stream)
Definition MimePart.cs:119
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_emptystringcall
Definition SR.cs:14
Definition SR.cs:7

References System.Net.Mail.AttachmentBase._part, System.SR.Format(), System.SR.net_emptystringcall, System.Net.Mime.MimePart.SetContent(), and System.stream.

Referenced by System.Net.Mail.AttachmentBase.AttachmentBase(), System.Net.Mail.AttachmentBase.AttachmentBase(), and System.Net.Mail.AttachmentBase.AttachmentBase().