WPF+WCF一步一步打造音频聊天室(一):概述

前几天在老徐的MSN群中聊WCF。我突然想到了用WPF和WCF来打造音频聊天室这么一个轮子。其实是这样的,我在的公司是两岸三地合作开发的。两岸是指大陆和台湾,三地是指深圳、台北、高雄。由于公司很小,所以一切都要节约成本,当然特别是我们深圳的开发团队,目前只有3个人,其中两个开发人员,一个Leader。现在我们两岸三地之间的沟通就是使用skype的,因为貌似其他的软件都要有软硬件的支持。skype只要每个成员有个带麦克风的耳机就行了。

    平时,我们深圳这边讨论问题,有一个很大的白板可以一边讲,一边写,一边讨论,还是不错的。但是Skype貌似没有共享写字板的功能,我们写的东西,台北和高雄那边看不到。由于我们项目开发基本是是使用WF、WPF以及WCF,故我自己打算用业余时间用WPF和WCF实现这么一个简单的会议软件,并计划一步一步完善,并放到Codeplex上面。我将使用三篇文章对现在这个程序进行简单的叙述,其实现在写这个程序,我只花了不到一天的时间。之所以打算用三个篇幅来写,想就算你从来没有接触过WPF和WCF也能看明白。

    在开始之前,我想说明白一件事情就是‘造轮子’。

    造轮子是贬义词,诚然搞这个东西确实是在造轮子,这里我写几点点对我来说造轮子的好处:

    1、自然是为了练好技术

    2、我将实现的方式一步一步写出来,自然是为了分享知识

    3、学习优秀产品的设计(QQ、MSN)。

    故我从不鄙视造轮子。腾讯靠的就是‘造轮子’,好了,废话不多说了,让我开始吧。

    第一篇只是一个简单的叙述,没有任何代码,和具体的实现。

    首先提出需求:

    1、文字聊天

    2、共享一个讨论问题的白板

    3、能进行语音通话

    4、聊天室成员查看     5、允许私聊

    6、用户进入/离开聊天室的广播通知

    8、聊天记录的保存
    9、视频(这个暂且没有去实现).

    使用技术:

    1、WPF

    2、WCF

    开发工具: VS2010

    功能分析:

    现在列出的功能非常的简单,界面使用WPF。通信使用WCF,WCF可以有四个方法:

    1、传输文字

    2、传输白板图像

    3、传输声音

    4、传输视频

    为了简化起见,我打算将聊天记录在本地的XML中,MSN采用的是这种方式

    最初版本的截图效果:

    1、登陆:

wpf1 

主面板:

wpf2

上图中的成员列表:当前聊天室的成员

上图中工具栏:包括一些常用的操作

上图中白板区域:共享的白板

上图中文字聊天区域:消息显示框和消息输入框

第一篇就写到这里,第二篇将会写到如何进行简单的WPF布局和一些WCF的常识,欢迎大家提出宝贵的建议,先谢谢。

作者:朱祁林
出处:http://zhuqil.cnblogs.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。


WCF & WPF 聊天程序源码For those that have read some of my other CodeProject articles you will probably know, that I am not shy about trying out new technologies. But one good thing about that is that I generally share what I learn right here, and this article is one of the hardest ones I've done IMHO. This article is about how to create a peer-to-peer chat application using Windows Communication Foundation (WCF) and also how to make it look nice using Windows Presentation Foundation (WPF).When I first started reading about WCF, the first place I looked was the MSDN WCF Samples (which I read a lot), but they weren't that great. I also found lots of chat apps based on the MSDN versions, which were no good as they could not return the list of users within the chat application. So I wanted to create a nice WPF styled app with the list of connected chatters. So I hunted around a bit more and eventually came across a damn fine/brilliant article by Nikola Paljetak, which I have tailored for this article. I have OK'd this with Nikola, and the original article content is here. To be honest the original article was pure brilliance (it should be mentioned Nikola is a Professor), but it took a while for me to get what was going on, as the code wasn't commented. I have now commented all code, so I think it will still make a very nice discussion/article for those that are new to WCF/WPF. I was totally new to WCF before this article, so if I can do it, so can all of you.So that's what this article is all about. At the end of the article, I would hope you understand at least some of the key WCF areas, and possibly be inspired enough to look at the WPF side of this article also.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值