请帮帮我
我使用实验室 jabber-net 在谷歌聊天中发送消息。Sometines 我有自动化和发送消息(运行应用程序时),但几乎总是我不能自动化也不发送消息......
使用代码 C#:
私有静态字符串消息;公共静态字符串 _message { 获取 { 返回消息;} 设置 { 消息 = 值;} }
private static string emailToSend;
public static string _emailToSend
{
get { return emailToSend; }
set { emailToSend = value; }
}
static JabberClient jc = new JabberClient();
static void SendMessageToGoogleTalk(string message, string emailToSend)
{
jc.User = "***@gmail.com";
jc.Server = "gmail.com";
jc.Password = "****";
_message = message;
_emailToSend = emailToSend;
jc.Connect();
jc.OnError += client_OnError;
jc.OnAuthenticate += client_OnAuthenticate;
jc.Close();
}
static void client_OnAuthenticate(object sender)
{
jc.Message(emailToSend, message);
}
static void client_OnError(object sender, Exception exception)
{
isRecieveMessage = false;
}
大家都知道,我怎么会导致这个问题?