有没有可以将 PHP 代码转换为 ASP.Net 的应用程序?

发布于 2024-08-06 01:56:43 字数 240 浏览 5 评论 0原文

我累了。我的项目中有大约 30 个非常混乱的 PHP 文件。听到人们说 Asp.net 更加结构化,更好(我在这里主要依赖 Jeff 的建议@codinghorror)并且可以使用 asp.net,而不使用 M$ 的臃肿软件嗯>。我不想也不会手动转换到目前为止所做的工作。

注意:我想要一个好的工具 - 我不想从大约 30 个非结构化且混乱的文件变成甚至更混乱的东西存储在具有奇数文件名的千亿个目录中(爪哇)

I'm tired. I have ~30 really messy PHP files in my project. Hearing people say that Asp.net is more structured , that it is better (I'm mostly relying on Jeff's advice @codinghorror here) and that it is possible to use asp.net without using bloated software from M$. I don't want to and will not convert the the work done upto now, by hand.

Note: I want a good tool -- I don't want to go from ~30 unstructured and messy files to even messier stuff stored in a quantillion directories with odd file names (Java)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

羁〃客ぐ 2024-08-13 01:56:43

困难在于,您可以在 ASP.NET 中自动执行一些在 PHP 中必须手动执行的操作。例如,如果我更改输入文本框,并且当我按 Tab 键离开时,我希望它自动保存,那么在 ASP.NET 中我可以使用 AutoPostback='true'。然后,在后面的代码中您将处理此更新。

我的观点是,ASP.NET 和 PHP 非常不同,因为 ASP.NET 可以使用很多工具,因此从 PHP 转到 ASP.NET 时,您的代码看起来会非常不同。

我认为使用工具将是一个坏主意,因为这种重写将使您有机会清理代码并决定使用哪些可用选项。

更新:为了对交互式应用程序进行更多操作,我推荐一个免费的工具包:
http://www.asp.net/ajax/AjaxControlToolkit/Samples/

The difficulty is that you can do some things automatically in ASP.NET that you have to do by hand in PHP. For example, if I change a input textbox and when I tab away I want it to be saved automatically, in ASP.NET I can use AutoPostback='true'. Then, in the code-behind you would handle this update.

My point is that ASP.NET and PHP are very different, in that there are so many tools that ASP.NET that you can use, so your code will look very different when going from PHP to ASP.NET.

I think using a tool would be a bad idea, as this rewrite would give you a chance to clean up the code and to decide which options to use that are available.

UPDATE: In order to do more with interactive applications there is a free toolkit available that I would recommend:
http://www.asp.net/ajax/AjaxControlToolkit/Samples/

孤蝉 2024-08-13 01:56:43

我以构建自动翻译工具为生(请参阅 DMS 软件重新工程工具包。 15 年的经验,仅此而已,不值得为 30 * 1000 行代码构建(“定制 DMS”或使用类似技术进行类似的操作)的麻烦。

我有 希望有人提前做到这一点,“哎呀,如果有人构建这样一个翻译器并且我可以使用它,这不是很热心吗?”这样的希望是相当渺茫的,问题是每个源应用程序都使用一些任意的东西。输入技术的组合(您可能正在使用 PHP、MySQL、JavaScript 和一些奇怪的库),并且想要一些输出技术的任意配置(ASP、TSQL、JavaScript、C# 库) 输入/输出配置的空间对于它来说太大了。您有真正的机会遇到有人可能已经构建了符合您需求的翻译器。因此,您需要一个自定义翻译器。哎呀,回到上一段。

你可以祈祷奇迹出现。但我建议您清理 PHP 文件并接受它们。这个世界充满了“小心你建造的东西,因为它的持续时间比你预期的要长得多”。下次更仔细地选择您的技术和架构,这样您就不会得到“混乱的文件”。

I build automated translation tools for a living (see DMS Software Reengineering Toolkit. In my 15 years of experience doing juist this, it isn't worth the trouble to build ("customize DMS" or do something similar with a similar techology if you can find it) a translator for 30 * 1000 lines of code.

You might be hoping for somebody to have done this in advance, "Gee, wouldn't it be keen if somebody built such a translator and I can just use it?" Such a hope is pretty forlorn. The problem is that every source application uses some arbitrary combination of input technologies (you're probably using PHP, MySQL, JavaScript and some weird libraries) and want some arbitrary configuration of output technologies (ASP, TSQL, JavaScript, C# libraries). The space of input/output configurations is too vast for you to have any real chance of encountering at translator that somebody might have built that matches your needs. Therefore you'll need a custom translator. Ooops, back to the previous paragraph.

You can pray for miracle. But I suggest you clean up your PHP files and live with them. The world is full of "beware what you build, because it will last a lot longer than you expect". Choose your technology and architecture more carefully next time, so you don't end up with "messy files".

一江春梦 2024-08-13 01:56:43

我不确定你能找到一个能够将 30 个凌乱的 PHP 文件转换为结构精美的 ASP 文件的程序,我认为有人会通过类似的东西赚到很多钱(而且我们很多人都会出局)的工作岗位)。然而,如果你真的想追求它,谷歌搜索“convert php to asp.net”会出现多个结果。

I'm not sure how much luck you'll have finding a program that'll convert 30 messy PHP files into beautifully structured ASP files, I think someone would make quite a fortune with something like that (and a lot of us would be out of jobs). However, if you really want to pursue it, googling for "convert php to asp.net" turned up multiple results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文