简体   繁体   English

System.Net如何实现?

[英]How is System.Net implemented?

I'm learning networking in C#, and I realized that I'm completely dependent on the System.Net framework for networking (not that this is a bad thing). 我正在用C#学习网络,我意识到我完全依赖System.Net框架进行网络连接(不是说这是一件坏事)。 I don't understand how, using standard language features, without relying on any framework, you can connect to a network via C#. 我不明白如何使用标准语言功能而无需依赖任何框架就可以通过C#连接到网络。

Like a lot of managed runtimes the underlying code relies on native functionality. 像许多托管运行时一样,底层代码也依赖于本机功能。 I could list the Win32 APIs that are used or you could just look at the source :) I prefer the latter. 我可以列出使用的Win32 API,或者您可以看一下源代码:)我更喜欢后者。

.NET source has been open for about 4 years now . .NET源代码已经开放了大约4年

The System.NET framework simply provides a managed wrapper around the windows API. System.NET框架仅提供围绕Windows API的托管包装。 If you want to see how MS does it, you can open the Assembly with a decompiler (Reflector or ILSpy) and look at the code. 如果要查看MS的运行方式,可以使用反编译器(Reflector或ILSpy)打开Assembly,然后查看代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM