简体   繁体   English

将C#Windows表单代码转换为C#Android代码

[英]Convert C# Windows forms code to C# Android code

I recently made a program in Windows Forms using Visual Studio but my friends asked me to make an app for it. 我最近使用Visual Studio在Windows窗体中制作了一个程序,但我的朋友要求我为此做一个应用程序。 I then noticed that Visual Studio has made it possible to make apps directly in C#. 然后我注意到Visual Studio使直接用C#制作应用程序成为可能。 But when I opened a new project it was different from what I'm used to (obviously). 但是,当我打开一个新项目时,它与我习惯的(显然)有所不同。

What I'm looking for is an easy way to convert my old windows forms code into the Android format but since I'm generally new to programming I don't know how myself. 我正在寻找的是一种将旧的Windows窗体代码转换为Android格式的简单方法,但是由于我通常对编程不熟悉,所以我不知道自己如何。 Do any of you have any tips or good tutorials that can help me? 你们中有任何技巧或好的教程可以对我有所帮助吗? I have been googling around but didn't find anything that helped me. 我一直在四处搜寻,但没有找到任何对我有帮助的东西。

You can't automatically. 您不能自动。 With Xamarin you can write your app in c# but you must rewrite a lot code, specially ui interface. 使用Xamarin,您可以使用C#编写应用程序,但必须重写很多代码,尤其是ui界面。 Maybe you can reuse some functions and logic 也许您可以重用一些功能和逻辑

I honestly don't think it is possible. 老实说,我认为不可能。

Windows forms is Windows Forms and Android is Android, these are two separate things that could be joined using Mono (Xamarin) for example. Windows窗体是Windows窗体,而Android是Android,例如,这是两个可以使用Mono(Xamarin)结合在一起的独立事物。

The code will not transform on it's own, and magically follow Android logic. 该代码不会自行转换,并且会神奇地遵循Android逻辑。 To create Android apps, you must learn Android. 要创建Android应用,您必须学习Android。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM