/// <summary> /// 使用系统账号向其它用户发送信息 /// </summary> /// <param name="subject">信息主题</param> /// <param name="content">信息内容</param> ///<param name="recvUsername">发送者的ID号</param> /// <returns>返回0, 发送失败;返回1, 发送成功</returns> public static int SendMessage(string subject, string content, string recvUsername) { int res = 0; IM im = new IM(); im.IMServer = server; im.ContentType = "Text/Html"; try { im.Port = Int32.Parse(port); } catch (Exception ex) { return res; } im.Init(server, username, password); res = im.SendMsg(subject, content, recvUsername, 0); return res; }