1

基本上,我得到了一个用 Visual Basic 编写的程序。我的问题是,我怎么可能将其转换为 Web 应用程序?我已阅读建议将其转换为 asp.net Web 应用程序。但是我该怎么做呢?我才真正开始,我真的需要一些分步说明。太感谢了。

4

3 回答 3

1

The stateless nature of web applications usually requires a totally different design than stateful desktop apps. (There is generally no state stored between clicks on the webserver, so every click(postback) is a brand new beginning from the server's point of view.)

Start by breaking down the app into the progression of screens present in the original app. Basically, everytime your desktop app has enough information to compute a new big chunk of the final output, that's a place where you might send the input data to the server for processing in your web version. In between each step, there's a new screen (or page) for the collection of new input and the display of what can be computed from the previously collected data.

On the server side, your old computation/database algorithms might be reusable if they don't contain much code for updating the Desktop app's UI.

There are a variety of ways for modeling your screens/pages. In .NET you've at least got ASP.NET, ASP.NET MVC, and even Silverlight.

于 2012-04-19T02:14:46.823 回答
1

没有“转换”过程。您将需要从头开始,并且不能合理地期望重用任何旧代码。这两个世界太不一样了。

首先记录现有应用程序的主要要求,然后使用它来设计和开发新网站。

于 2012-04-19T02:26:02.627 回答
0

脚步

  • 如果未知,请选择您的新环境。
  • 如果您还不知道,请好好学习新环境
  • 将代码转换为所需的框架

代码转换

VB 代码很可能是程序性的,没有类。将其复制并粘贴到您的新环境中。你可以做“全部”或一块一块地做。这可能取决于细节,但我建议所有这些,以便您可以立即进行批量变量重命名和函数语法清理。比如VB转PHP,就得$在每个变量前面加上。您还必须更改函数头以符合新环境。

如果您逐段移植代码,则必须为每段代码一遍又一遍地做同样的事情。如果您对整个代码库执行一次,优化代码最初可能需要更多时间,但您将执行一次批量操作而不是多次。

编写测试

如果你正在经历代码转换的麻烦,你不妨做对。测试将

  • 确保您已正确转换功能

专注于封装功能核心,应用程序的引擎

于 2015-10-28T17:25:45.517 回答