邮箱服务器配置验证失败,ntp服务器连接异常
privateboolchecksmtp (string SMTP server,int port,string username,string password )。
{
TCP客户端TCP客户端=new TCP客户端(SMTP服务器,端口;
if (! wite for (流,' 220 ' ) )返回假;
send command (流,' AUTH LOGIN\r\n ' );
if (! wite for (流,' 334 ' ) )返回假;
send command (流,基本编码) username ) '\r\n ' );
if (! wite for (流,' 334 ' ) )返回假;
send command (流,base64encode ) password ) '\r\n ' );
if (! wite for (流,' 235 ' ) )返回假;
返回真;
}
私有蓝牙(networkstreamstream,string strCode ) )。
{
int StreamSize;
byte[dydbd=new byte[1024];
流大小=stream.read (wj dtk,0,wjdtk.Length );
string return value=encoding.default.getstring (wj dtk ).substring(0,StreamSize );
返回返回值. substring (0,3 ).equals ) strcode );
}
私有语音命令(networkstreamstream,字符串流)。
{
byte [ ]写入缓冲器;
wite buffer=encoding.default.getbytes (strcmd );
stream.write (写入缓冲器,0,写入缓冲器. length );
}
私有基础64编码(字符串str )。
{
byte[] barray;
barray=encoding.default.getbytes (str;
return convert.to base64 string (barray );
}http://feiyun0112.cnblogs.com/