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


C# SmtpResponse.ToString方法代码示例

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


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

示例1: ToString_MultiLineMessage

 public void ToString_MultiLineMessage()
 {
     SmtpResponse r = new SmtpResponse(200, "Multi line message line 1\r\n" +
     "Multi line message line 2\r\n" +
     "Multi line message line 3");
     Assert.Equal("200-Multi line message line 1\r\n" +
     "200-Multi line message line 2\r\n" +
     "200 Multi line message line 3\r\n", r.ToString());
 }
开发者ID:rnwood,项目名称:smtp4dev,代码行数:9,代码来源:SmtpResponseTests.cs

示例2: RunCommand

        public void RunCommand(string command, SmtpResponse expectedSmtpResponse)
        {
            _writer.WriteLine(command);

            var line = _reader.ReadLine();

            if (line == null)
                throw new InvalidOperationException("Stream has unexpectedly closed");

            if (line != expectedSmtpResponse.ToString())
                throw new InvalidOperationException(String.Format("After command '{0}' received '{1}' but expected '{2}'", command, line, expectedSmtpResponse));
        }
开发者ID:kdblocher,项目名称:simple.mailserver,代码行数:12,代码来源:TestConnection.cs

示例3: SendResponseAsync

        private static async Task SendResponseAsync(SmtpConnection connection, SmtpResponse response)
        {
            LogResponse(response);

            foreach (var additional in response.AdditionalLines)
                await connection.WriteLineAsyncAndFireEvents(additional);

            await connection.WriteLineAsyncAndFireEvents(response.ToString());
        }
开发者ID:dapaxx,项目名称:simple.mailserver,代码行数:9,代码来源:SmtpServer.cs

示例4: ToString_SingleLineMessage

 public void ToString_SingleLineMessage()
 {
     SmtpResponse r = new SmtpResponse(200, "Single line message");
     Assert.Equal("200 Single line message\r\n", r.ToString());
 }
开发者ID:rnwood,项目名称:smtp4dev,代码行数:5,代码来源:SmtpResponseTests.cs


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