【发布时间】:2011-06-19 00:05:58
【问题描述】:
TcpClient client = new TcpClient("69.147.112.160", 443);
SslStream sslStream = new SslStream(client.GetStream(),false,
ValidateServerCertificate,null);
try
{
sslStream.AuthenticateAsClient("mail.yahoo.com");
}
catch (AuthenticationException e)
{
return;
}
byte[] messsage = Encoding.UTF8.GetBytes(".<EOF>");
sslStream.Write(messsage);
sslStream.Flush();
byte[] buffer = new byte[4096];
int bytes2 = -1;
do
{
/**************************************************
*** JUST A LINE BELOW ALL buffer BYTES ARE ZERO!**
*************************************************/
bytes2 = sslStream.Read(buffer, 0, 4096);
m_sockClient.Send(buffer, bytes2, 0);
} while (bytes != 0);
【问题讨论】: