2

help me please

I using labrary jabber-net to send message in google chat. Sometines I have autorization and send message(when run application), but almost allways I can't autorization and don't send message...

using code C#:

private static string message; public static string _message { get { return message; } set { message = value; } }

    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;
    } 

Everybody know, how I can result this problem?

4

1 に答える 1

1

これは一般的なエラーのようです。基本的@gmail.comに、ユーザー フィールドに を指定せずにユーザー名を試す必要があります。

おそらく、次のことを試してください。

jc.User = "username";
jc.Server = "gmail.com";
于 2012-05-17T09:20:42.333 に答える