如何将 C# 控制台应用程序移植到 Windows Phone [英] How to port C# Console application to Windows Phone
问题描述
基本上,控制台应用程序使用一个 Web 服务,我想对 Windows Phone 应用程序做同样的事情.我知道 WP7 在网络服务方面的工作方式有所不同,我想知道这是否可行.
Basically, the console application consumes a web service, and I want to do the same with windows phone application. I know that things work differently with WP7 with respect to web services, and I would like to know if this is possible.
控制台版本使用 wp7 不允许的命名空间 System.Web.Services.我还能怎么做?
The console version uses the namespace System.Web.Services which is not allowed for the wp7. How else could I achieve the same?
推荐答案
您必须编写一个 WCF 服务,并且使用该服务您可以通过控制台应用程序执行您想要执行的所有功能.
You have to write a WCF service and using that service you can execute all the functionality that you want to do via console application.
然后将该 WCF 服务引用到您的 wp7 应用程序中,您就完成了.网上有很多帮助,这里有 2 个.希望这对你有帮助.
Then refer that WCF service into your wp7 app and you are done. There are lot of help available online, here are 2. Hope this will help you.
这篇关于如何将 C# 控制台应用程序移植到 Windows Phone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!