- 浏览: 416472 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
lkun__blog:
网页打不开啊
博客搬家到http://cuiz.me -
bglmmz:
楼主怎么解决的?我用python调用ice服务,也出现此问题, ...
syscall exception: 存储空间不足,无法处理此命令 -
luliangy:
哥,你什么配置,我10W个请求10秒左右就搞定了,毫无压力,R ...
Nginx和Apache简单的并发压力测试 -
liuxuejin:
这!看的我都···········。我看代码而已。怎么
EPOLL及消息队列实现SMTP 之 青楼的故事 -
zires:
night_stalker 写道unicorn 也很好维护啊, ...
Unicorn和Passenger性能测试对比
SDK2.8 联系人及联系人集合操作
入口类,实现了主程序和插件借口:
using System.Linq; using System; using System.Collections.Generic; using System.Threading; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Text; using wwsdkcomLib; using System.Xml; namespace TC01 { public class Global { public static int lPluginCookie; public static int lCookie; public static object pSlot; public static string appid = "13141123"; public static object pApplication; } [ComVisible(true), Guid("B61D33ED-9689-4551-B102-A00E2B437938"), ClassInterface(ClassInterfaceType.None)] public class Class1 : ISDKPlugin2, ISDKDevPlugin { public void OnConnect(object pApplication, int lPluginCookie) { // OnConnect 不建议使用末态对话框 //ISDKPluginQueryResult pqr = (pApplication as ISDKApplication3).GetSubScriptionInfo(lPluginCookie) as ISDKPluginQueryResult; //Global.appid = pqr.appID; Global.lPluginCookie = lPluginCookie; Global.pApplication = pApplication; } public void OnDisconnect(object pApplication, int lPluginCookie) { // OnDisConnect 不建议使用末态对话框 // MessageBox.Show("我被卸载了", "csharp helloworld"); } public void OnNotify(SDKMessageID MsgID, object pParam) { if (MsgID == SDKMessageID.NOTIFY_OFFLINE) { } else if (MsgID == SDKMessageID.NOTIFY_USERLOGIN) { } } public void OnUninstall() { } public void Require() { } } [ComVisible(true), Guid("D8A84BDF-6681-4c17-8B7B-A416C7BCF6A4"), ClassInterface(ClassInterfaceType.None)] public class Class2 : ISDKPluginItem { Form1 f1; public void OnMenuClick(int lCmdID) { } // 插件作为按钮出现时候得到点击后被调用 // 本例中此方法将在点击发生后得到调用 public void OnClick() { MessageBox.Show("进入工作平台"); try { this.f1.Show(); } catch (Exception ex) { this.f1 = new Form1(); this.f1.Show(); } } // 插件接入到插槽后得到通知 public void OnCreate(object pSlot, int hParentWnd, int lCookie) { Global.lCookie = lCookie; Global.pSlot = pSlot; } // 插件在附属插槽被销毁时候得到通知 public void OnDestroy() { // 使用模态对话框可能导致异常 // MessageBox.Show("聊天对话框输入工具条插件被销毁", "csharp allinone plugin"); } // 和插件项本身相关的消息通知 public void OnNotify(SDKItemNotifyID MsgIDD, object pParam) { } // 当插件以窗口形式出现情况下,在父窗口发生变化情况下得到通知 public void OnSize(int cx, int cy) { } } }
插件类,实现了插件的具体功能:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using wwsdkcomLib; namespace TC01 { public partial class Form1 : Form { ISDKContact3 ct3; ISDKContact2 ct2; ISDKContactMgr3 ctm3; ISDKContactMgr2 ctm2; ISDKLoginUser3 luser3; ISDKApplication3 app3; public Form1() { //MessageBox.Show("开始加载"); InitializeComponent(); try { this.app3 = (Global.pApplication as ISDKApplication3); //MessageBox.Show("pApplication"); } catch (Exception ex) { MessageBox.Show("(Global.pApplication as ISDKApplication);\n" + ex); } try { this.ctm3 = this.app3.GetContactMgr(Global.lPluginCookie) as ISDKContactMgr3; } catch (Exception ex) { MessageBox.Show(" (Global.pApplication as ISDKApplication3).GetContactMgr(Global.lPluginCookie) as ISDKContactMgr3;\n"+ex); } try { this.luser3 = this.app3.GetLoginUser(Global.lPluginCookie) as ISDKLoginUser3; //MessageBox.Show("GetLoginUser OK"); } catch (Exception ex) { MessageBox.Show(" (Global.pApplication as ISDKApplication3).GetLoginUser as ISDKLoginUser3;\n" + ex); } try { this.textBox5.Text ="用户昵称 ; "+ this.luser3.GetNickName(Global.lPluginCookie); this.textBox5.Text += "\r\n用户活跃度 : "+this.luser3.GetActivitiesLevel(Global.lPluginCookie); this.textBox5.Text += "\r\n当前服务器时间 : " + this.luser3.GetServerTime(Global.lPluginCookie); //this.textBox5.Text += "\r\n用户Status : " + this.luser3(Global.lPluginCookie); this.textBox5.Text += "\r\n用户SiteID : " + this.luser3.GetSiteID(Global.lPluginCookie); this.textBox5.Text += "\r\n用户SiteName : " + this.luser3.GetSiteName(Global.lPluginCookie); this.textBox5.Text += "\r\n用户UserID : " + this.luser3.GetUserID(Global.lPluginCookie); this.textBox5.Text += "\r\n用户WWID : " + this.luser3.GetWangID(Global.lPluginCookie); //MessageBox.Show("UserInfo OK"); } catch (Exception ex) { MessageBox.Show(" (Global.pApplication as ISDKApplication3).GetLoginUser as ISDKLoginUser3;\r\n" + ex); } //MessageBox.Show("加载完毕"); } private void button1_Click(object sender, EventArgs e) { try { string tempstr=this.textBox1.Text; this.ct3 = this.ctm3.GetContact(Global.lPluginCookie, tempstr) as ISDKContact3; this.label3.Text=this.ct3.GetUserID(Global.lPluginCookie); } catch(Exception ex) { MessageBox.Show("this.ctm2.GetContact(Global.lPluginCookie, this.label1.Text) as ISDKContact2;\n" + ex); } } private void button2_Click(object sender, EventArgs e) { try { this.textBox4.Text = this.ct3.GetNickName(Global.lPluginCookie); } catch(Exception ex) { MessageBox.Show("this.ct3.GetNickName(Global.lPluginCookie);\n"+ex); } } private void button3_Click(object sender, EventArgs e) { try { this.textBox4.Text = this.ct3.GetSiteID(Global.lPluginCookie); } catch (Exception ex) { MessageBox.Show("this.ct3.GetSiteID(Global.lPluginCookie);\n" + ex); } } private void button4_Click(object sender, EventArgs e) { try { this.textBox4.Text = this.ct3.GetSiteName(Global.lPluginCookie); } catch (Exception ex) { MessageBox.Show("this.ct3.GetSiteName(Global.lPluginCookie);\n" + ex); } } private void button5_Click(object sender, EventArgs e) { try { ISDKGroup sdkGroup = (this.ct3.GetInGroup(Global.lPluginCookie) as ISDKGroup); string s = sdkGroup.GetGroupName(Global.lPluginCookie); this.textBox4.Text = s; } catch (Exception ex) { MessageBox.Show("this.(ct3.GetInGroup(Global.lPluginCookie) as ISDKGroup).GetGroupName(Global.lPluginCookie);\n" + ex); } } private void button6_Click(object sender, EventArgs e) { ISDKObjectCollection ct3s; string tempstr = "GetNickName" + "\t" + "GetSiteID" + "\t" + "GetSiteName" + "\t" + "GetInGroup" + "\t用户Status" + "\r\n"; try { ct3s=this.ctm3.GetRecentContactCollection(Global.lPluginCookie) as ISDKObjectCollection; foreach(ISDKContact3 ct3 in ct3s){ tempstr += (ct3.GetNickName(Global.lPluginCookie)+"\t"+ct3.GetSiteID(Global.lPluginCookie) +"\t"+ct3.GetSiteName(Global.lPluginCookie)+"\t"+(ct3.GetInGroup(Global.lPluginCookie) as ISDKGroup).GetGroupName(Global.lPluginCookie)+"\t"+ct3.GetStatus(Global.lPluginCookie)+"\r\n"); } tempstr +="\n最近联系人总数为:" + ct3s.Count; this.textBox3.Text = tempstr; } catch (Exception ex) { MessageBox.Show("this.ctm3.GetRecentContactCollection(Global.lPluginCookie) as ISDKObjectCollection;"); } } private void button7_Click(object sender, EventArgs e) { ISDKObjectCollection ct3s; string tempstr = "GetNickName" + "\t" + "GetSiteID" + "\t" + "GetSiteName" + "\t" + "GetInGroup" + "\t用户Status" + "\r\n"; try { ct3s = this.ctm3.GetFilterContactCollection(Global.lPluginCookie) as ISDKObjectCollection; foreach (ISDKContact3 ct3 in ct3s) { tempstr += (ct3.GetNickName(Global.lPluginCookie) + "\t" + ct3.GetSiteID(Global.lPluginCookie) + "\t" + ct3.GetSiteName(Global.lPluginCookie) + "\t" + (ct3.GetInGroup(Global.lPluginCookie) as ISDKGroup).GetGroupName(Global.lPluginCookie) + ct3.GetStatus(Global.lPluginCookie) + "\r\n"); } tempstr += "\n黑名单联系人总数为:" + ct3s.Count; this.textBox3.Text = tempstr; } catch (Exception ex) { MessageBox.Show("this.ctm3.GetFilterContactCollection(Global.lPluginCookie) as ISDKObjectCollection;"); } } private void button8_Click(object sender, EventArgs e) { ISDKObjectCollection ct3s; string tempstr = "GetNickName" + "\t" + "GetSiteID" + "\t" + "GetSiteName" + "\t" + "GetInGroup" + "\t用户Status" + "\r\n"; try { ct3s = this.ctm3.GetStrangerContactCollection(Global.lPluginCookie) as ISDKObjectCollection; foreach (ISDKContact3 ct3 in ct3s) { tempstr += (ct3.GetNickName(Global.lPluginCookie) + "\t" + ct3.GetSiteID(Global.lPluginCookie) + "\t" + ct3.GetSiteName(Global.lPluginCookie) + "\t" + (ct3.GetInGroup(Global.lPluginCookie) as ISDKGroup).GetGroupName(Global.lPluginCookie) + ct3.GetStatus(Global.lPluginCookie) + "\r\n"); } tempstr += "\n陌生联系人总数为:" + ct3s.Count; this.textBox3.Text = tempstr; } catch (Exception ex) { MessageBox.Show("this.ctm3.GetStrangerContactCollection(Global.lPluginCookie) as ISDKObjectCollection;"); } } private void button16_Click(object sender, EventArgs e) { //活跃度级别 MessageBox.Show("活跃度级别 : "+this.luser3.GetActivitiesLevel(Global.lPluginCookie)); } private void button17_Click(object sender, EventArgs e) { MessageBox.Show("旺号 : " + this.luser3.GetWangID(Global.lPluginCookie)); } private void button18_Click(object sender, EventArgs e) { MessageBox.Show("昵称 : " + this.luser3.GetNickName(Global.lPluginCookie)); } } }
插件如下:
发表评论
-
使用CURL库在编译时遇到的问题
2010-12-29 18:49 9217表现: windows平台,使用libcur ... -
Apache模块-下载文件-性能测试打靶用的靶子
2010-12-16 18:30 2583apache模块, 下载某一个文件, 性能测试打靶用, ... -
[分享我的经验]Cpp项目测试方案设计及实现
2010-07-15 16:04 923##第一次做Cpp项目的测试设计,代码的语法还 ... -
epoll+消息队列-通过使用pthread_cond_signal的一个简单实现
2010-06-27 15:40 5956第一次用epoll去实现一 ... -
这里写的都是关于Flex的废话,不吐不快
2009-12-17 16:51 767我靠, 一个对象在MXML和AS里面一般都通用,MXML里面 ... -
Flex代码组织结构的一点经验
2009-12-15 14:23 2216在开始设计部门内部太极项目二期的时候,就一直在反思一期工作中的 ... -
要以可持续发展的眼光去做技术选型,嘿嘿^-^
2009-11-29 13:16 911部门内部有个很不错的 ... -
Your Kit Profiler解析Java性能
2009-07-22 16:24 1899#The below params will open the ... -
我知道了Ext总发出毫无意义的Http请求的原因
2009-05-08 17:21 876以前看别的项目组用Ext做的项目时,会发现经常有错误的请求发出 ... -
用JS处理HttpWatch转到的POST参数没有分隔好时候的方法
2009-01-12 15:46 1721HttpWatch版本太老的时候会出现post的参数被Http ... -
JavaScript画的股票曲线图
2008-12-16 14:42 3237目前做成这样了,用JavaScript的canvas画的,为了 ... -
javascript 中 outerHTML 、innerHTML、innerTEXT 三者的区别
2008-12-11 17:51 798Z:http://blog.52z.com/post/304. ... -
只有IE知道这句注释
2008-12-10 19:57 881<!--[if IE]>只有IE知道这句注释!&l ... -
图解程序设计关键词
2008-12-04 17:30 1124... -
练练手,好久不写都要生疏了
2008-11-22 01:26 878<!DOCTYPE HTML PUBLIC " ... -
(轻便)调试JavaScript的旺旺插件(基于jzshmyt的javascript-logger)
2008-11-21 10:16 1245Demo如下,大家拍砖吧! 请看下面介绍: ... -
我的Httpunit+Junit文件上传API测试用例
2008-07-29 14:16 2716package com.alisoft.aep.sip.cor ...
相关推荐
官网gwt SDK ,通过java 开发前端页面,并且自动解决页面兼容及国际化问题,以MVP为主开发模式
nVidia_Physx_SDK_2.8.4.6(part2)
阿里旺旺sdk安装包
这是阿里软件最新的旺旺SDK开发包。里面包含完整的例子程序、开发文档和相关代码说明及例子。For 旺旺卖家版
Canon Digital EOS SDK (ED-SDK v2.8) 开发包 跟别人买的。这里免费发了。 开发案例请找我:349717267
nVidia_Physx_SDK_2.8.4.6(part3)
64位windows amd平台的opencl安装软件。安装之后sample在:C:\Users\xx\Documents\AMD APP\
wwsdk 旺旺SDK二次开发包 添加旺旺界面新组件等
imformix client sdk 4.10 for windows 32位 支持64位informix数据库,使用和配置方法更方便。
androidsdk插件源码,实现功能有插屏,通知栏,桌面推送,随机弹推送。
ucloud codeigniter sdk整合插件
clientsdk.2.90.TC6.WIN,经常使用的一个客户端工具,绝对可用!Informix是IBM公司出品的关系数据库管理系统(RDBMS)家族。作为一个集成解决方案,它被定位为作为IBM在线事务处理(OLTP)旗舰级数据服务系统。 IBM对...
浙江大华摄像头Web3.0网页播放SDK插件包 设置好ddns和端口映射, 使用本sdk包, 可以在网页上播放远程摄像头实时/历史视频.
Forward.NET平台下利用Visual Studio 2002做二次开发必备库,包括头文件、库文件、开发手册,饱含2.7和2.8两个版本,其中Vc7为VS2002下的安装目录,找到相应路径后导入,这样在VS2002中新建项目时即可看到相应模板。
海康威视 2018-11-28 最新视频Web插件62M(SDK 、Demo 、Demo 使用说明、开发指南)!!! 提供适用于Windows操作系统IE、Chrome、Firefox浏览器的视频预览与录像回放功能,支持32位和64位浏览器。
IDA_Pro_5.2_五合一_(安装-破解-SDK-插件-汉化).
官网的下起来很卡
chrome已经宣布新版本得chrome浏览器不在支持NPAPI,IE也被微软放弃,Edge浏览器除了部分企业版依旧支持ActiveX插件以外也不在支持ActiveX,webkit内核得浏览器对ACtiveX插件得支持并不完善,并且webkit内核对网页得...
informix client sdk.3.50 ,大小为112M,所以分为两个卷,大家下载请看准了。这是第一个哦。
arcgis-pro-sdk:Microsoft .NET的ArcGIS Pro SDK是ArcGIS Pro应用程序的新.NET SDK