当前位置: 首页>>代码示例>>C#>>正文


C# ActiveUp.StoreToFile方法代码示例

本文整理汇总了C#中ActiveUp.StoreToFile方法的典型用法代码示例。如果您正苦于以下问题:C# ActiveUp.StoreToFile方法的具体用法?C# ActiveUp.StoreToFile怎么用?C# ActiveUp.StoreToFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActiveUp的用法示例。


在下文中一共展示了ActiveUp.StoreToFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendQueued

                    /// <summary>
		            /// Sends the message using the specified queuing service and spool directory.
		            /// </summary>
		            /// <param name="message">The message to send.</param>
		            /// <param name="spoolDirectory">The full path to the full directory.</param>
		            /// <param name="queuingService">The queuing service to use.</param>
		            public static void SendQueued(ActiveUp.Net.Mail.Message message, string spoolDirectory, ActiveUp.Net.Mail.QueuingService queuingService)
		            {
			            _UIDcounter++;
			            if (_UIDcounter > 99999)
				            _UIDcounter = 0;

			            string UID = System.DateTime.Now.ToString("yyMMddhhmmss")+System.DateTime.Now.Millisecond.ToString()+_UIDcounter.ToString().PadLeft(5, '0');

			            ActiveUp.Net.Mail.Logger.AddEntry("UID Created for filename: '" + UID + "'", 0);

			            switch (queuingService)
			            {
				            case ActiveUp.Net.Mail.QueuingService.MicrosoftSmtp:
				            case ActiveUp.Net.Mail.QueuingService.ActiveQ:
					            message.StoreToFile(spoolDirectory.TrimEnd('\\') + "\\" + UID + ".eml", true);
					            break;
				            case ActiveUp.Net.Mail.QueuingService.IpSwitchIMail:
					            string imailQueued = spoolDirectory.TrimEnd('\\') + "\\" + "D" + UID + ".SMD";
					            string imailSpec = spoolDirectory.TrimEnd('\\') + "\\" + "Q" + UID + ".SMD";
					            System.Text.StringBuilder imailDef = new System.Text.StringBuilder();
					            imailDef.Append("Q" + imailQueued + "\n");
					            imailDef.Append("H" + message.From.Email.Split('@')[1]);
					            imailDef.Append("S" + message.From.Email);
					            foreach(ActiveUp.Net.Mail.Address address in message.To)
						            imailDef.Append("R" + address.Email);
					            foreach(ActiveUp.Net.Mail.Address address in message.Cc)
						            imailDef.Append("R" + address.Email);
					            foreach(ActiveUp.Net.Mail.Address address in message.Bcc)
						            imailDef.Append("R" + address.Email);
					            System.IO.StreamWriter sw = System.IO.File.CreateText(imailSpec);
					            sw.Write(imailDef);
					            sw.Close();
					            message.StoreToFile(imailQueued, true);
					            break;
			            }
		            }
开发者ID:JBTech,项目名称:MailSystem.NET,代码行数:42,代码来源:SmtpClient.cs


注:本文中的ActiveUp.StoreToFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。