[译]流行的DotNetNuke Web应用程序到C#的转换
By robot-v1.0
本文链接 https://www.kyfws.com/applications/a-conversion-of-the-popular-dotnetnuke-web-applica-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 4 分钟阅读 - 1771 个词 阅读量 0[译]流行的DotNetNuke Web应用程序到C#的转换
原文地址:https://www.codeproject.com/Articles/16977/A-conversion-of-the-popular-DotNetNuke-web-applica
原文作者:andrewcates
译文由本站 robot-v1.0 翻译
前言
In an attempt to open DotNetNuke to a wider audience, I have converted the original VB code into C#
为了向更广泛的受众开放DotNetNuke,我将原始的VB代码转换为C#
介绍(Introduction)
点网核(DotNetNuke) 是一个开源Web应用程序框架,非常适合创建,部署和管理交互式Web,Intranet和Extranet网站.它得到很好的支持;看看(is an open source web application framework ideal for creating, deploying and managing interactive web, intranet and extranet sites. It is very well supported; just take a look at) 大雪覆盖(Snow Covered) .不幸的是,VB和C#程序员没有尽其所能地合作,而是在两种语言之间选择了互斥的选择.这是不幸的,因为DotNetNuke是ASP.NET的非常完善的框架,许多C#程序员都不希望看到.(. Unfortunately, VB and C# programmers don’t cooperate as best they should, and take a mutually exclusive choice between the languages. This is unfortunate because DotNetNuke is a very well developed framework for ASP.NET that a lot of C# programmers do not want to look at.)
目的(Purpose)
为了向更广泛的受众开放DotNetNuke,我将原始的VB代码转换为C#. 2006年10月28日,我发布了第一个成功的C#版本.今天,1月2日,我已经修复了大多数错误,并在C#中拥有了不错的DNN可行副本.(In an attempt to open DotNetNuke to a wider audience, I have converted the original VB code into C#. On Oct. 28, 2006 I released the first successful build in C#. Today, Jan 2, I have fixed most of the bugs and have a decent workable copy of DNN in C#.)
得到教训(Lessons Learned)
在翻译代码的整个过程中,我吸取了很多教训.乍一看,您可能会像我一样认为翻译VB代码会很容易.否则,我花了不到十分钟的时间就学会了这个项目.首先,我尝试使用VB转换来翻译代码,并编译产生的源代码,并带有3,000多个错误.这显然是行不通的.其次,我尝试使用Lutz Roeder的Reflector来查看已编译二进制文件中的代码.尽管这会带来更好的结果,但这不是可行的解决方案.如果我想及时完成此工作以使其有用,那么我需要一条替代路线.最终,我想出了一个解决方案,该解决方案将前两种方法结合在一起,并且我专门为此项目制作了一些专用工具来完成该任务.(Throughout the course of translating the code I learned many lessons. At first guess, you might think that translating the VB code would be easy, as did I. It wasn’t more than ten minutes into this project that I learned otherwise. First, I attempted to translate the code using VB Conversions and compiled the resultant source code with over 3,000 errors. This obviously wasn’t going to work out. Second, I tried to use Lutz Roeder’s Reflector to look at the code from the compiled binary. Although this resulted in slightly better results, it wasn’t a viable solution. If I was ever to complete this in time to be deemed useful I needed an alternative route. Finally I came up with a solution that was a combination of the first two methods, and some specialized tools I made specifically for this project to get it done.)
结果(Results)
转换代码的结果是,新的C#版本比其VB表亲快得多地运行.我还可以通过编译和生成网站中所有页面和类的单个命名程序集来提高其速度.由于ASP.NET不允许,这并不是那么容易(As a result of converting the code, the new C# version runs incredibly much faster than its VB cousin. I was also able to increase its speed by compiling and generating a single named assembly for all pages + classes in the website. This wasn’t that easy due to ASP.NET not allowing) App_GlobalResources
在预编译的网站中,但是我可以通过嵌入(in pre-compiled websites, but I was able to get around this bug by embedding the) GlobalResources
和(and) SharedResources
进入DotNetNuke.Library库,并使用(into the DotNetNuke.Library library, and using a) ResourceLoader
从程序集中的嵌入式资源中提取字符串.然后将其余的配置文件放入config目录中.(to extract the strings from the embedded resources in the assembly. The remaining config files were then placed into the config directory.)
结论(Conclusion)
我对该项目进行了转换,以使其自己和其他C#程序员更加可读,并向更多的读者开放DotNetNuke.(I converted this project to make it more readable by myself and other C# programmers and open the DotNetNuke to a larger audience.)
谷歌代码(Google Code)
该项目托管在Google Code上.请拜访(The project is hosted on Google Code. Please visit) Project的Google Code网站(Project’s Google Code website) 有关最新的错误修复和发布.(for the latest bug fixes and releases.)
重要连结(Important Links)
- 这个(This) 是Google代码所在的项目.(is the project home at Google code.)
- 这个(This) 是SVN信息库.(is the SVN repository.)
新闻(News)
2007年1月5日:修复了新的错误,在安装过程中加载了所有模块,用户注册工作,并且修复了大多数明显的错误.(Jan. 5, 2007: New bug fixes, modules all load during install, user registration works, and most obvious bugs have been fixed.)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C# SQL C#2.0 Windows .NET .NET2.0 VS2005 SQL-Server-2005 Dev DBA 新闻 翻译