ASP.NET MVC应用程序与客户端通信的最佳方式(带有Windows Mobile的移动设备)
我有一个客户端服务器应用程序,服务器端是 asp.net mvc,客户端是带有 windows mobile 6 的移动设备。基本上,客户端进行身份验证,获取一些数据,创建数据库,对其进行一些操作,然后发送数据返回到服务器(登录、下载、上传)。
我使用 HttpWebRequest 类从客户端获取/发送数据,我这样做:当客户端请求数据时,我使用 FileHelpers 将这些对象写入文件中,最后我从所有这些文件中创建一个 .rar 并将这些字节写入响应流,在客户端上,我再次使用 FileHelpers 解压缩并从文件中获取对象。上传操作也会发生同样的情况。
实现这种沟通的最佳方式是什么,因为我认为我在那里所做的事情有点像马屎,或者?
I have a client server app, the server side is asp.net mvc and the client side is a mobile device with windows mobile 6. Basically, the client authenticates, gets some data, create a databse, makes some operations on it then sends the data back to the server (Login, Download, Upload).
I get/send data from the client using HttpWebRequest class and i do like this: when the client requests data i write those objects in files using FileHelpers and in the end i make a .rar from all those files and i write those bytes in the response stream and on the client i unrar and get the objects from files using FileHelpers again.The same is happening for the Upload operation.
What is the best way to realize this communication because i think it's kinda horse shit what i'm doing in there, or?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Glenn Block 刚刚发表了一篇关于通过 WCF 流式传输内容的非常好的文章:
http://blogs.msdn.com/b/gblock/archive/2010/11/24/streaming-over-http-with-wcf.aspx
我真的很喜欢 WCF数据服务与oData 个人支持二进制对象和流:
http://msdn.microsoft.com /en-us/library/ee473426.aspx
http://blogs.msdn.com/b/astoriateam/archive/2010/09/08/data-services-streaming-provider-series-part-2-accessing-a-media-resource-stream-from-the-客户端.aspx
Glenn Block just did a very good post on streaming content over WCF:
http://blogs.msdn.com/b/gblock/archive/2010/11/24/streaming-over-http-with-wcf.aspx
I really like WCF Data Services & oData personally and they support binary objects and streaming:
http://msdn.microsoft.com/en-us/library/ee473426.aspx
http://blogs.msdn.com/b/astoriateam/archive/2010/09/08/data-services-streaming-provider-series-part-2-accessing-a-media-resource-stream-from-the-client.aspx