Big Bug Ban

兴趣 践行 创新

飞信2009的协议 分析

 

20071288305663_2

这里说的飞信2009是指2008圣诞后的那个版本..

首先给大家一个连接

http://openfetion.sourceforge.net/

openfection…这是一个用飞信2008协议做的php版本

不过在2009年12月..飞信官网更新后已经不再可用

和之相比.主要有几点不同的地方

1.登陆的ip

http://221.176.31.42/ht/sd.aspx

https://uid.fetion.com.cn/ssiportal/SSIAppSignIn.aspx

而以前的地址是:
http://221.130.44.194/ht/sd.aspx

https://nav.fetion.com.cn/ssiportal/SSIAppSignIn.aspx

2.sipc协议内容

这个是登陆时的

SIP-C/2.0 401 Unauthoried
F: 744975375

I: 1

Q: 1 R

W: Digest algorithm=”MD5-sess;SHA1-sess”,nonce=”64FDB89911D5E8F01E5992451413FBE8″

客户机登陆

R fetion.com.cn SIP-C/2.0
F: 744975375

I: 1

Q: 2 R

A: Digest algorithm=”SHA1-sess”,response=”E37012467C5908AB4C49DF6764E65CDC”,cnonce=”4016E15442B23A26351188B46CE4F72D”,salt=”011D0200″,ssic=”CBIOAAD/ZPwYfXIYLIRmGmMZfvtr/pefbkzcs+h71JkUZA/xoi9fkMpxCzhg5J6QWH85WfS22OK8Re1YUsXI1I6KPhUsnTC7A33KmcWhjqgtGpwXSuHbpA9WC94Zvxs0u/+rxKwAAA==”

L: 344

<args><device type=”PC” version=”2009111402″ client-version=”3.5.1170″ /><caps value=”simple-im;im-session;temp-group;personal-group;im-relay” /><events value=”contact;permission;system-message;personal-group;compact” /><oem-tag value=”cmcc.sjb0.inet.0382″ /><user-info attributes=”all” /><presence><basic value=”0″ desc=”” /></presence></args>

找个时间好好研究下…话说我的php的curl就是不写cookie…郁闷..

找问题ing..

Written by princehaku

12月 27th, 2009 at 1:42 上午

Posted in technology

with one comment

ubuntu 想说爱你不容易

 

logo

想说爱你不容易啊!!!

好容易崩溃哦…

找个时间慢慢弄下…

Written by princehaku

12月 25th, 2009 at 11:13 下午

Posted in linux

Tagged with

without comments

c++ .net 动态释放控件

 

如果使用create创建的 就用destroywindow
如果使用new创建的 就用delete
ps : gcnew和new一样 用delete

Written by princehaku

12月 23rd, 2009 at 1:33 下午

Posted in c/c++

without comments

c++ .net 动态添加控件 及其事件处理

 

一个简单的例子

例子如下

Capture

按下button后实时生成了个RadioButton

然后再单击生成的RadioButton

字由A变成DDD

	System::Windows::Forms::RadioButton^ node1 = gcnew System::Windows::Forms::RadioButton();
	node1->AutoSize = true;
	node1->Location = System::Drawing::Point(19, 34);
	node1->Name = L"node1";
	node1->Size = System::Drawing::Size(32, 17);
	node1->TabIndex = 0;
	node1->TabStop = true;
	node1->Text = a;
	node1->UseVisualStyleBackColor = true;
	node1->Click += gcnew System::EventHandler(this, &Form1::node_Click);
	this->Controls->Add(node1);

button1_Click里面写上这个

注意最后的node1->Click += gcnew System::EventHandler(this, &Form1::node_Click);

就是事件绑定,我将其绑定到了node_Click这个函数上

然后再写node_Click函数


void node_Click(System::Object^  sender, System::EventArgs^  e) {
         System::Windows::Forms::RadioButton^ a= (System::Windows::Forms::RadioButton^)sender;
	 a->Text="DDD";
 }

Written by princehaku

12月 23rd, 2009 at 1:21 下午

Posted in 未分类

Tagged with

without comments

C# 文件 写入文件时的编码

 

StreamWriter sw = new StreamWriter(new FileStream(jug.path.tmppath + filename + ".cpp",

FileMode.Create),System.Text.Encoding.GetEncoding("gb2312"));

就这一句..

主要的地方是StreamWriter的构造函数StreamWriter ( FileStream , Encoding )

Written by princehaku

12月 22nd, 2009 at 8:59 上午

Posted in c/c++

Tagged with

without comments

ie ajax bug ..又一个..

 

无语得很…
ie啊..ie…怎么又有bug了说…
上次是options的innerhtml问题
这次是ajaxflash的问题
先ajax了一个flash的object
然后再用flash父元素的innerHTML来改
就…..
flash 的 FlashVars 属性就莫名奇妙得丢了..想个办法搞定之…

Written by princehaku

12月 21st, 2009 at 12:21 下午

Posted in technology

Tagged with

without comments

wordpress 统计阅读次数

 

如果要在后台看到…添加一个插件

postviews-for-admin

如果想在页面上让访问者能够看到..

用postviews 或者postviews plus

然后编辑你的主题吧..

在想显示的地方写上

Written by princehaku

12月 19th, 2009 at 2:41 下午

Posted in php

Tagged with

without comments

stl vector 简单例子

 

#include 
#include 
#include 
using namespace std;

int main()
{
  //一个vector
  vector vec;

  vec.push_back(4);
  vec.push_back(1);
  vec.push_back(3);
  vec.push_back(9);

  // STL中的排序算法
  sort(vec.begin(), vec.end());

  //输出结果
  for (int i = 0; i < vec.size(); i ++)
    cout << vec[i] << "\n";
}

Written by princehaku

12月 18th, 2009 at 9:27 上午

Posted in c/c++

without comments

c++ 最稳定婚姻问题

 

/* marrage.cpp : 定义控制台应用程序的入口点。
 * author baizhongwei
 * website http://blog.webpcpp.net
 * 最稳定婚姻问题
 * create time 2009-12-15 16:17
 */

#include "stdafx.h"
#include 
#include 
#include 
#include 
#include "time.h"
using namespace std;
//好感度的类
class goodfeeling{
private:
	//对象编号
	int p_num;
	//好感度
	int g_degree;
public:
	goodfeeling(int people_num,int good_degree){
		g_degree=good_degree;
		p_num=people_num;
	}
	int getHot(){
		return g_degree;
	}
	int getPeoplenum(){
		return p_num;
	}
};
//用感觉度进行正向排序,
int imp(goodfeeling A,goodfeeling B){

	if(A.getHot()>=B.getHot())
		return 1;
	else
		return 0;
}
//用感觉度进行反向排序,
int reimp(goodfeeling A,goodfeeling B){

	if(A.getHot()>B.getHot())
		return 0;
	else
		return 1;
}
class people{

private:
	//好感表
	vector lovers;
	//是否正在约会
	int  meetting;
	//这个人的编号
	int num;
	//性别  男是1  女是0
	int sex;

	int metwho;
public:
	int getwho(){
		return this->metwho;
	}
	int getsex(){
		return sex;
	}
	int getnum(){
		return num;
	}
	//构造函数
	people(int num,int sex){
		this->num=num;
		this->sex=sex;
		this->meetting=0;
		this->metwho=0;
	}
	//是否正在约会
	bool isMeeting(){
		return meetting;
	}
	//让他去约会sb.
	bool gomet(people m){
		if(isMeeting())
		{
			cout<<"女孩正在和"<gethotnum(metwho))
			{
				int old=metwho;
				metwho=m.getnum();
				//抛弃以前那个
				throw int(old);
			}
			else{
				//约见失败
				return false;
			}
		}
		else
		{

			meetting=1;

			metwho=m.getnum();
		}
		//成功约会
		return true;
	}
	//设定感觉系数
	int setfeel(goodfeeling num){
		//对象的序号
		lovers.insert(lovers.end(),num);
		//根据好感度排序已有的人物
		sort(lovers.begin(),lovers.end(),imp);

		return 1;

	}
	int gethotnum(int p){

		for(int i=0;i gun;

	gun.push(boy[0]);

	gun.push(boy[1]);

	gun.push(boy[2]);
	int i=0;

	while(!gun.empty()&&i++<20)
	{
		//让队首小男孩去见梦中情人
		int t=meeting(gun.front(),girl[gun.front().getHotestlover()-1]);

		if(t!=0&&t!=99)
		{
			//让被抛弃的男孩重回光棍队列
			boy[t-1].setfree(gun.front().getHotestlover());
			gun.push(boy[t-1]);
		}
		//如果是被抛弃的..入队..
		if(t==99)
		{
			gun.front().setfree(gun.front().getHotestlover());
		}
		if(gun.front().isMeeting())
		{
			boy[gun.front().getnum()-1]=gun.front();
			gun.pop();
		}
	}
	cout<<"----------------------"<

Written by princehaku

12月 16th, 2009 at 4:58 下午

Posted in c/c++

without comments

windows7和xp 共享方法

 

之前看了哈网上的..感觉不是很好用

把自己的经验写一下

首先

是防火墙

最好关了..

或者添加一个例外

Untitled

如图第一个 允许程序通过 加上135端口或者把windows share给弄进去

然后第二步

Untitled

右下角打开网络共享中心

然后点选择共享选项

Untitled

第三个 choose homegroup and sharing setting

进去后点高级设置

里面有两个 第一个写的是home or work..下面的是public

就是 你进入一个新网络的时候选择的那个

建议如果要共享就选homegroup

话说windows7自己带个homegroup 的选择

不过个人觉得弄麻烦了

它是考虑到了安全性

然后每个电脑上都设置一个homegroup的用户

密码相同则可访问

其实和下面我说的差不多

回到正题..

进去高级选项后里面有几个选项比较重要

第一个是网络发现

点开后别人才能在网上邻居看到你

第二就是 把密码保护的共享关了

不然别人需要密码才得访问你

第三个 最后一项 选第二个

意思是不用让windows通过homegroup来进行管理

然后确认吧..基本上xp访问你就没问题了

Untitled

最后就是你访问xp

windows xp默认有一项

禁止空密码访问

2009012017505617[1]

在Windows XP计算机的“运行”编辑框中输入“Gpedit.msc”命令并回车,打开“组策略”窗口。然后在左窗格中依次展开“计算机配置/Windows 设置/安全设置/本地策略”目录,并单击选中“安全选项”。在右窗格列表中找到“账户:使用空白密码的本地账户只允许进行控制台登录”选项,默认处于“已启用”状态。因为Windows XP的安全策略中采用了“拒绝优先”的原则,所以空口令的用户通过网络访问使用Windows XP的计算机时便会被禁止

最后记得把guest那个用户打开

到此就差不多啦

Written by princehaku

12月 16th, 2009 at 4:38 下午

Posted in technology

without comments