Wednesday, January 27, 2010

FetionInterFace.cs

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using PowerTalkBoxContrls.Design;
using PowerTalkBoxEnum.Enum;
using PowerTalkBox;
using System.Collections.Generic;

///
/// FetionInterFace 的摘要说明
///

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class FetionInterFace : System.Web.Services.WebService
{

public FetionInterFace()
{

//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
///
/// 添加信息
///

/// 我的ID,一般为手机号
/// 对方ID,游客12345
/// 发送的信息
///
[WebMethod]
public void ChatAdd(string MyUserId, string ToUserID, string SendMsg)
{
PowerTalk.AddChatInfo(MyUserId, ToUserID, SendMsg);
}
///
/// 删除
///

/// 我的ID,一般为手机号
[WebMethod]
public void DeleteUserInfo(string DelUserId)
{
PowerTalkBox.PowerTalk.DeleteUserInfo(DelUserId);
}
///
/// 获取聊天内容
///

/// 我的ID,手机号码
///
[WebMethod]
public List GetChatInfos(string MyUserName)
{
List < ChatInfo > LCI = PowerTalk.ReadChatInfo(MyUserName, PowerTalkBoxEnum.Enum.SystemMode.WebToIm);
foreach (ChatInfo In in LCI)
{
In.SendContent = In.SendContent.Replace("

", "").Replace("

","").Replace(" "," ");
}
return LCI;
}

}

No comments:

Post a Comment