到底是&QUOT什么;管理" code?QUOT、code

2023-09-02 11:56:05 作者:妄念

我已经写C / C ++ code将近二十年了,我知道Perl,Python和PHP和一些Java为好,我自学的JavaScript。但我从来没有做过任何.NET,VB或C#的东西。这到底是什么管理code是什么意思? 维基百科描述其简称为$ C,根据虚拟机的管理执行$ C,并它明确表示,Java是(通常)管理code,那么为什么这个词似乎只适用于C#/。NET?你可以编译C#到包含VM中的.exe文件,以及,或者你必须把它包装起来,并把它给另一个.exe文件(一拉JAVA)?

I've been writing C / C++ code for almost twenty years, and I know perl, python, php, and some java as well, and I'm teaching myself javascript. But I've never done any .NET, VB, or C# stuff. What exactly does "managed" code mean? Wikipedia describes it simply as "code that executes under the management of a virtual machine", and it specifically says that Java is (usually) managed code, so why does the term only seem to apply to C# / .NET? Can you compile C# into a .exe that contains the VM as well, or do you have to package it up and give it to another .exe (a la java)?

在此类似,是.NET中的语言的或框架的,而究竟是什么框架的意思是在这里吗?

In a similar vein, is .NET a language or a framework, and what exactly does "framework" mean here?

好了,所以这是一个以上的问题,但对于某人谁一直在同行业中,只要我有,我感觉相当N00B-ISH现在...

OK, so that's more than one question, but for someone who's been in the industry as long as I have, I'm feeling rather N00B-ish right now...

推荐答案

在编译C#code到一个.exe文件,它被编译到公共中间语言(CIL)字节code。当你运行一个可执行文件CIL它是在微软的公共语言运行时(CLR)虚拟机执行。所以没有,这是不可能包括在VM withing您的.NET可执行文件。您必须安装在你的程序将要运行的任何客户端机器上的.NET运行库。

When you compile C# code to a .exe, it is compiled to Common Intermediate Language(CIL) bytecode. Whenever you run a CIL executable it is executed on Microsofts Common Language Runtime(CLR) virtual machine. So no, it is not possible to include the VM withing your .NET executable file. You must have the .NET runtime installed on any client machines where your program will be running.

要回答你的第二个问题,.NET是一个框架,因为它是一组库,编译器和VM不特定的语言。所以,你可以code在C#,VB,C ++和它有一个.NET编译器的任何其他语言的.NET框架。

To answer your second question, .NET is a framework, in that it is a set of libraries, compilers and VM that is not language specific. So you can code on the .NET framework in C#, VB, C++ and any other languages which have a .NET compiler.

http://www.dotnetpowered.com/languages.aspx

上面的页面有语言链接的列表具有.NET版本,以及为自己的网页。

The above page has a listing of languages which have .NET versions, as well as links to their pages.