需要帮助就有关.NET程序的执行流程及相关的基本哎呀很基本的问题基本、流程、程序、问题

2023-09-07 09:50:06 作者:作业你就该&冰清玉洁

怀疑有关.NET程序的执行流程

有几个一年我的工作是如何C#赢或Web应用程序运行的一个发展,但我有知识的缺乏。当我们从IDE中运行应用程序,然后编译器是如何来到现场,编译我们的程序后,再怎么程序启动....怎么CLR来到现场,如何准时来到现场。谁接管程序的入口点控制。谁调用程序入口点所谓的静态无效的主要()禁区外喜欢。 CLR如何参与承担执行程序和放大器的责任;谁涉及到CLR。 JIT如何参与,谁参与了JIT。为什么切入点是静态无效的主要()?

很多书帮我们写code与C#,但从来没有谈论程序执行流程....如何在.NET程序运行。当我们点击任何.NET的exe再怎么EXE越来越运行。所以我有一些疑问....如果可能的话,请详细讨论上述问题,或点我朝着正确的文章。

有关怀疑OOPS

1)我看到了一个类,它是私人的,但构造函数是公共....为什么?这是什么意思。有没有什么特殊的目的,这就是为什么类是这样设计的。

2)我看到了公共类,但它有三个构造一个是私有的,一个是静态的,最后一个是公开的......有没有什么特殊的目的设计一个类以这种方式。

3)静态类总是有静态构造函数?

4)如果一个公共类具有与静态构造函数正常构造,然后会是怎样的目的。

如果可能的话,请详细讨论上述OOPS问题........感谢

解决方案   能帮我画个C 程序的流程图吗 给高分

当我们从IDE中运行应用程序,然后编译器是如何来到现场,编译我们的节目

IDE将启动编译并传递你的程序。编译器是另一个程序。它不需要特别的调用。您可以通过只调用 csc.exe的直接

做自己没有一个IDE   

和以后再怎么程序启动....怎么CLR来到现场,如何准时来到现场。谁接管程序的入口点控制。谁调用程序入口点所谓的静态无效的主要()禁区外喜欢。 CLR如何参与承担执行程序和放大器的责任;谁涉及到CLR。 JIT如何参与,谁参与了JIT。

在JIT是动态的IL-到本地编译器。这就是翻译的IL的.NET语言编译成这样的程序可以实际运行。

在CLR是pretty的多少另一个世界在你使用它的方式,JIT。我不打算进入细节在这里,但你可以找到更多MSDN上。

  

为什么切入点是静态无效的主要()?

公约。为什么语言,所谓的C#?

  

我看到了一个类,它是私人的,但构造函数是公共....为什么?这是什么意思。有没有什么特殊的目的,这就是为什么类是这样设计的。

这是使私营类可以从外部类实例化。例如:

 公共类A {
    私人的东西=新的B();

    私有类B {
        市民B(){
            // ...
        }
    }
}
 

如果构造不是公开私人类不能被外部类实例化。

  

我看到公共类,但它有三个构造一个是私有的,一个是静态的,最后一个是公开的......有没有什么特殊的目的设计一个类以这种方式。

当然。他们都做不同的事情。这不是如此不同寻常。

  

静态类总是有静态构造函数?

没有。静态构造函数实际上是非常罕见的。当然,静态类不能有一个正常的构造。

  

如果一个公共类具有与静态构造函数正常构造,然后会是怎样的目的。

正常的构造函数初始化对象。静态构造函数被调用第一次使用这个类。仅仅因为一个类有两个不让它与众不同,你可以使用该功能的任何事情。

Doubt about .net program execution flow

for few year i am working as a develop but i have lack of knowledge for how C# win or web apps run. when we run application from IDE then how compiler come into scene to compile our program and after then how program start....how CLR come into scene and how JIT come into scene. who take control over the entry point of program. who invoke program entry point so called static void Main() from outside like. how CLR involve to take the responsibility for executing the program & Who involve the CLR. how JIT involve and who involve the JIT. why the entry point is static void main() ?

lot of book help us to write code with C# but never talk about the program execution flow....how a .net program is running. when we click on any .net exe then how exe is getting run. so i have some doubt....if possible then please discuss the above issue in detail or point me towards right article.

Doubt about OOPS

1) i saw a class which was private but constructor was public....why...what does it mean. is there any special purpose that is why class is designed like this.

2) i saw public class but it has three constructor one was private, one was static and last one was public......is there any special purpose to design a class in this way.

3) static class always have static constructor?

4) if a public class has normal constructor along with static constructor then what will be the purpose.

if possible then please discuss the above OOPS issue in details........thanks

解决方案

when we run application from IDE then how compiler come into scene to compile our program

The IDE starts the compiler and passes it your program. The compiler is another program. It doesn't need special invocation. You can do it yourself without an IDE by just calling csc.exe directly.

and after then how program start....how CLR come into scene and how JIT come into scene. who take control over the entry point of program. who invoke program entry point so called static void Main() from outside like. how CLR involve to take the responsibility for executing the program & Who involve the CLR. how JIT involve and who involve the JIT.

The JIT is the dynamic IL-to-native compiler. It's what translates the IL that .NET languages are compiled into so that the programs can actually run.

The CLR is pretty much another world for the JIT in the way you're using it. I'm not going to go into detail here, but you can find out more on MSDN.

why the entry point is static void main() ?

Convention. Why is the language called C#?

i saw a class which was private but constructor was public....why...what does it mean. is there any special purpose that is why class is designed like this.

It's so that the private class can be instantiated from the outer class. For example:

public class A {
    private something = new B();

    private class B {
        public B() {
            // ...
        }
    }
}

If the constructor weren't public, the private class could not be instantiated by the outer class.

i saw public class but it has three constructor one was private, one was static and last one was public......is there any special purpose to design a class in this way.

Sure. They all do different things. It's not so unusual.

static class always have static constructor?

No. Static constructors are actually very rare. Of course, a static class cannot have a normal constructor.

if a public class has normal constructor along with static constructor then what will be the purpose.

The normal constructor is called to initialize an object. The static constructor is called the first time the class is used. Just because a class has both doesn't make it special, you could use that functionality for just about anything.