1

引用Path.DirectorySeparatorChar 的文档

该字段的值在 Unix 上是一个斜杠(“/”),在 Windows 和 Macintosh 操作系统上是一个反斜杠(“\”)。

MS,因为该文本至少从.net 1.1开始就存在,是否在预期未来的端口或创建(类似)Mono 时写了这个?或者我可以在非 MS 操作系统上运行 .net 吗?

4

1 回答 1

3

You will have to read about .NET's history and its close relationship with Java, so as to know of why such designs exist in the API.

Microsoft shiped Java, and even extended its feature set by developing J++. But SUN bans such attempts and that's why .NET was born. Thus, .NET is very similar to Java, and its API generally speaking is portable.

http://en.wikipedia.org/wiki/Visual_J%2B%2B

http://en.wikipedia.org/wiki/.NET_Framework

However, Microsoft never releases .NET Framework for any other platforms except Windows, which is an obvious strategy to promote Windows. The only exception so far is a product called Silverlight for Mac, which ports a lite version of .NET Framework to OS X,

http://support.microsoft.com/kb/981760

Mono and Xamarin.iOS/Android/Mac is probably not what Microsoft expected around 2000, but now even Microsoft uses such products, and welcome the innovations from the community.

IMHO, .NET is only a brand for CLR on Windows. Mono and Xamarin.* can be seen as the brands for CLR on other platforms. So if you rephrase your last question to "can I run a CLR based application on a non-MS OS", I would like to answer that "yes, it is".

于 2013-08-13T03:43:40.513 回答