C# 即时通讯工具帮助
我想用 C# 启动一个简单的 Windows P2P 即时通讯程序,
我将在这里提出一些我需要概念和技术方面指导的问题。
假设用户已成功登录到他的帐户,应用程序现在需要获取并填充联系人列表(保存在我的 apache/php/mysql 服务器上)。
您将如何实现数据检索(重要)以及随后的联系人列表填充? WebClient.DownloadString[Async] 是一个好方法吗?有更好的方法吗?
应用程序应多久检查一次更新列表(在线/离线状态)。已接受建议。
如何在 C#.NET (Visual C# Studio 2010) 上解析 JSON 数据,我将获得 JSON 字符串。
谢谢!
I want to start a simple windows P2P instant messenger in C#
I'll put here some questions I need guidance for, in the conceptual and technical aspects.
Let's say the user had successfully logged into his account, and the app needs now to get and populate the list of contacts (saved on my apache/php/mysql server).
How would you implement the data retrieval (important) and later population of the contacts list? Is WebClient.DownloadString[Async] a good approach? Is there a better way?
How often should the app check for updated list (online/offline statuses). Recommendations accepted.
How can I parse JSON data on C#.NET (Visual C# Studio 2010) I will get JSON strings.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在链接用户 ID 的单独表中拥有用户关系。数据检索应该通过一个存储过程进行,该存储过程收集服务器上该用户的所有数据并将它们发送给该用户。
您应该对更新系统使用观察者模式,然后每当状态发生更改时,您都会向用户客户端发送一条消息,从而更改状态。
不确定,但我很确定有这方面的库功能。
You should have user relations in a seperate table that links user ID's. The data retreival should happen through a stored procedure that collects all data for that user on the server and sends them to the user.
You should use the Observer pattern for the update system, then whenever there is a status change you send a message to the user client, that changes the status.
Not sure but I'm pretty sure there is library functionality for this.