- 授权协议: LGPL
- 开发语言: C# .NET
- 操作系统: Windows
- 软件首页: http://code.google.com/p/jabber-net/
- 软件文档: http://code.google.com/p/jabber-net/w/list
软件介绍
JabberNet 是一个 .NET 的 Jabber (XMPP)协议的客户端开发包,示例代码:
using System;
using System.Threading;
using jabber.client;
namespace SendMessage
{
class Program
{
// we will wait on this event until we're done sending
static ManualResetEvent done = new ManualResetEvent(false);
// if true, output protocol trace to stdout
const bool VERBOSE = true;
const string TARGET = "otheruser@example.com";
static void Main(string[] args)
{
JabberClient j = new JabberClient();
// what user/pass to log in as
j.User = "someuser";
j.Server = "example.com"; // use gmail.com for GoogleTalk
j.Password = "somepassword";
// don't do extra stuff, please.
j.AutoPresence = false;
j.AutoRoster = false;
j.AutoReconnect = -1;
// listen for errors. Always do this!
j.OnError += new bedrock.ExceptionHandler(j_OnError);
// what to do when login completes
j.OnAuthenticate += new bedrock.ObjectHandler(j_OnAuthenticate);
// listen for XMPP wire protocol
if (VERBOSE)
{
j.OnReadText += new bedrock.TextHandler(j_OnReadText);
j.OnWriteText += new bedrock.TextHandler(j_OnWriteText);
}
// Set everything in motion
j.Connect();
// wait until sending a message is complete
done.WaitOne();
// logout cleanly
j.Close();
}
static void j_OnWriteText(object sender, string txt)
{
if (txt == " ") return; // ignore keep-alive spaces
Console.WriteLine("SEND: " + txt);
}
static void j_OnReadText(object sender, string txt)
{
if (txt == " ") return; // ignore keep-alive spaces
Console.WriteLine("RECV: " + txt);
}
static void j_OnAuthenticate(object sender)
{
// Sender is always the JabberClient.
JabberClient j = (JabberClient)sender;
j.Message(TARGET, "test");
// Finished sending. Shut down.
done.Set();
}
static void j_OnError(object sender, Exception ex)
{
// There was an error!
Console.WriteLine("Error: " + ex.ToString());
// Shut down.
done.Set();
}
}
}
Spring揭秘
王福强 / 人民邮电出版社 / 2009.8 / 99.00元
没有教程似的训导,更多的是说故事般的娓娓道来,本书是作者在多年的工作中积累的第一手Spring框架使用经验的总结,深入剖析了Spring框架各个模块的功能、出现的背景、设计理念和设计原理,揭开了Spring框架的神秘面纱,使你“知其然,更知其所以然”。每部分的扩展篇帮助读者活学活用Spring框架的方方面面,同时可以触类旁通,衍生出新的思路和解决方案。 本书内容全面,论述深刻入理,必将成为每......一起来看看 《Spring揭秘》 这本书的介绍吧!
Markdown 在线编辑器
Markdown 在线编辑器
RGB CMYK 转换工具
RGB CMYK 互转工具
