如何转换PHP到.NET对于初学者 [英] How to Convert PHP to .NET For Beginners
问题描述
哪些选项我有PHP转换为C#/ ASP.NET?
What options do I have for converting PHP to C#/ASP.NET?
我有一个非常艰难的时间寻找这方面的资料,所以我创造了这个问题/答案是,对于那些你们谁也打击这种拦路虎的一站式服务。
I had a really tough time finding information on this, so I've created this question/answer to be a one stop shop for those of you who have also hit this kind of stumbling block.
总之,我会解释我已经找到了不同的工具,什么工作为我,也将您链接到一些转换指南。
In short, I will explain the different tools I'd found, what worked out for me, and also link you to some conversion guides.
推荐答案
微软的PHP到ASP.NET迁移助手
http://www.asp.net/downloads/archived -v11 /迁移助理/ PHP到ASPNET
优点:
微软有一个PHP到ASP.NET迁移助手!它并不完美,但确实相当不错,尽管在语言固有的差异。它不会为您创建codebehind,而是把生成的C#中的脚本标记在.aspx文件中。
缺点:
这是得到这个工作,因为它是有点老了挑战,要求我安装<一href=\"http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe\"相对=nofollow>的Microsoft .NET Framework 1.1的Redist 和<一个href=\"http://download.microsoft.com/download/8/b/4/8b4addd8-e957-4dea-bdb8-c4e00af5b94b/NDP1.1sp1-KB867460-X86.exe\"相对=nofollow>的Microsoft .NET Framework 1.1 Service Pack 1的 VS2010中为了安装迁移助手本身。
Microsoft's PHP to ASP.NET Migration Assistant
http://www.asp.net/downloads/archived-v11/migration-assistants/php-to-aspnet
The Good:
Microsoft has a PHP to ASP.NET Migration Assistant! It's not perfect, but does fairly well despite the differences inherent in the languages. It doesn't create the codebehind for you, but rather, puts generated C# in a script tag in an .aspx file.
The Bad:
It was a challenge getting this working because it's a little old and required me to install Microsoft .NET Framework 1.1 Redist, and Microsoft .NET Framework 1.1 Service Pack 1 in VS2010 in order to install the Migration Assistant itself.
你们有些人可能与这些框架的安装麻烦。如果你这样做,我发现了一个方便的花花公子指南在这里:<一href=\"http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-to-install-net-framework-11-in-windows-7-64/eb1e6232-e874-432e-ab43-17660e25e43d?page=1&tm=1345067625733\" rel=\"nofollow\">http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-to-install-net-framework-11-in-windows-7-64/eb1e6232-e874-432e-ab43-17660e25e43d?page=1&tm=1345067625733
Some of you may have trouble with these Framework installations. If you do, I found a handy dandy guide right here: http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-to-install-net-framework-11-in-windows-7-64/eb1e6232-e874-432e-ab43-17660e25e43d?page=1&tm=1345067625733
另外,当年我得到它安装后,它并没有出现在我的转换工具VS2010。所以,我不得不这样做:
<一href=\"http://forums.asp.net/t/1530808.aspx?no%20PHP%20to%20ASP%20NET%20Migration%20Assistant%20in%20MS%20Visual%20Studio%202008\" rel=\"nofollow\">http://forums.asp.net/t/1530808.aspx?no+PHP+to+ASP+NET+Migration+Assistant+in+MS+Visual+Studio+2008
Also, after I'd gotten it to install, it wasn't appearing in my conversion tools in VS2010. So, I had to do this: http://forums.asp.net/t/1530808.aspx?no+PHP+to+ASP+NET+Migration+Assistant+in+MS+Visual+Studio+2008
回复:没有PHP到ASP.NET迁移助手在MS Visual Studio 2008中
2012年4月11日10:15 |友情链接
Re: no PHP to ASP.NET Migration Assistant in MS Visual Studio 2008 Apr 11, 2012 10:15 PM|LINK
一旦你安装迁移助手打开一个DOS窗口直通
cmd.exe,在DOS窗口:将目录更改为:CD C:\\文件
和设置\\ spatel> CD C:\\ Program Files文件\\ Microsoft Corporation在\\ PHPŤØ
ASP.NET迁移助手然后输入以下内容并点击进入
:PHPCONVERT.EXE C:\\ PhpSourceDirectory /输出C:\\ ASPoutputdirectory
从Visual Studio 2008和choolse内打开项目
兑换。注:上述C步骤3:\\ PhpSourceDirectory是我在哪里
存储了我的PHP文件和类似的C:\\ ASPoutputdirectory是我
希望我的ASP.net输出去了。
Once you install the Migration assistant open a DOS window thru CMD.exe In the dos window : Change directory to: CD C:\Documents and Settings\spatel>cd C:\Program Files\Microsoft Corporation\PHP t o ASP.NET Migration Assistant Then type in the following and click enter : PHPCONVERT.EXE C:\PhpSourceDirectory /Out C:\ASPoutputdirectory Open the project from within Visual Studio 2008 and choolse to convert. Note: in the step 3 above C:\PhpSourceDirectory is where I had my PHP files stored and similarly C:\ASPoutputdirectory is where I wanted my ASP.net output to go.
PHPCONVERT.EXE具有您可以通过键入查看其他选项。
PHPCONVERT.EXE /?
PHPCONVERT.EXE has other options that you can explore by typing in PHPCONVERT.EXE /?
当我看到这个论坛...我给了希望,但PHPCONVERT.EXE是一个生命
金丹,我努力工作的转换减少了90%。
When I saw this forum ...I gave hope but PHPCONVERT.EXE was a life saver , my work effort reduced by 90% for the conversion.
该转换器的最新版本可@
http://www.asp.net/downloads/archived -v11 /迁移助理/ PHP到ASPNET
The latest version of the convertor is available @ http://www.asp.net/downloads/archived-v11/migration-assistants/php-to-aspnet
我会注意到,这些命令行需要扭捏作的x86机器。 PHPCONVERT.EXE可能是程序文件(x86),而不是程序文件。
I'll note that these command lines needed tweaking for an x86 machine. PHPCONVERT.EXE might be in Program Files(x86) instead of Program Files.
总体而言,它花了一些时间,但是这就是我必须做的就是它的工作,我希望这可以帮助你摆脱当前绑定的。
Phalanger - 一个PHP编译器的Visual Studio
如果你想PHP在你的.net应用程序编译尝试Phalanger
HTTP://www.php-compiler。净/
Overall, it took some time, but that's what I had to do to get it working, I hope that this helps you out of your current bind.
Phalanger - A PHP Compiler for Visual Studio
If you want PHP to compile in your .NET app try Phalanger
http://www.php-compiler.net/
我很感兴趣,但最终决定不这样做,由于牌照费。然而,他们在GitHub上,如果你想看看。
https://github.com/DEVSENSE/Phalanger
转换PHP自己
这里有一些资源学习PHP的基础知识,以及裸机转换指南。
http://learnxinyminutes.com/docs/php/
的 HTTP://www.$c$cstore.net/store.nsf/unid/BLOG -20100603-0518
I was interested in this, but ultimately decided against it due to licence fees. However, they are on GitHub if you want to check it out.
https://github.com/DEVSENSE/Phalanger
Converting PHP Yourself
Here are some resources for learning PHP basics, and a bare-bones conversion guide.
http://learnxinyminutes.com/docs/php/
http://www.codestore.net/store.nsf/unid/BLOG-20100603-0518
谢谢大家!所有最优秀的你,快乐编码。
Thanks everyone! All the best to you, and happy coding.
这篇关于如何转换PHP到.NET对于初学者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!