是“DriveInfo.GetDrives()”一个windows api? [英] Is "DriveInfo.GetDrives()" a windows api?

查看:75
本文介绍了是“DriveInfo.GetDrives()”一个windows api?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DriveInfo.GetDrives()一个windows api?

Is DriveInfo.GetDrives() a windows api?

推荐答案

嗯...没有。



API是:用于构建软件和应用程序的一套例程,协议和工具。



API根据其操作,输入,输出和底层类型表示软件组件,定义独立于其各自实现的功能,这允许定义和实现在不影响接口的情况下变化。良好的API使得通过提供所有构建块来开发程序更容易,然后程序员将它们放在一起。
( - 应用程序编程接口 - 维基百科,免费的百科全书 [ ^ ])



DriveInfo.Getdrives [ ^ ]是DriveInfo类中的单个静态方法。
Um...no.

An API is: "a set of routines, protocols, and tools for building software and applications.

An API expresses a software component in terms of its operations, inputs, outputs, and underlying types, defining functionalities that are independent of their respective implementations, which allows definitions and implementations to vary without compromising the interface. A good API makes it easier to develop a program by providing all the building blocks, which are then put together by the programmer."
( -- Application programming interface - Wikipedia, the free encyclopedia[^])

DriveInfo.Getdrives[^] is a single static method in the DriveInfo class.


当然,OriginalGriff绝对正确他指出,特定.NET库中的特定C#方法不是 Windows API。



但是,单词 API现在已经具有更广泛的意义,并且经常被松散地使用。 .NET的大部分内容都提供了底层低级Windows OS API的接口;调用低级API的具体语法因.NET语言实现而异。



我建议你区分应用程序的非常具体的单位意义可以从应用程序执行的软件,在实际意义上的意思是你可以做的事情的接口。



Visual Studio公开API用于加载项(如ReSharper)与IDE和编译器互操作。如今,冰箱可能会暴露出一种API,允许它由某种家庭网络物联网应用程序控制。但是,冰箱暴露的控制代码或其他任何东西,允许一个软件监视和控制它,肯定不等同于Microsoft Word。



当像Visual Studio这样的应用程序公开一个非常强大的接口时,它允许第三个接口。派对开发人员使用插件与其内部引擎互操作,我倾向于将其视为原始用法的正式意义中的更多API。



所以,一如既往,挑战是让你选择如何使用术语API:如果我在求职面试中,我可能会以同样的方式作出回应在这里回答,但可能忽略对冰箱的引用:)
Of course, OriginalGriff is absolutely correct when he points out to you that a specific C# method in a specific .NET library is not the Windows API.

However, the word "API" has come to have a broader meaning, these days, and is often used "loosely." Much of .NET provides an interface to the underlying lower-level Windows OS API; the specific syntax of how that lower level API is invoked varies with the .NET language implementation.

I suggest you distinguish "application" in its very specific sense of a unit of software that can be executed from "application" in the practical sense of that word meaning "an interface that you can do something with."

Visual Studio exposes an API for add-ins (like ReSharper) to inter-operate with the IDE and compiler. A refrigerator, these days, may expose an API that allows it to be controlled by some kind of home network IOT application. But, the control-codes, or whatever, the refrigerator exposes to allow a piece of software to monitor and control it, are certainly not the equivalent of Microsoft Word.

When an application, like Visual Studio, exposes an interface which is quite robust that allows 3rd. party developers to inter-operate with its internal "engines" using add-ins, I'd be inclined to see that as more an API in the "formal sense" of its original usage.

So, the challenge, as always, is for you to make your choice about how you use the term "API:" if I were in a job interview, I'd probably respond in much the same way I respond here, but maybe leave out the reference to refrigerators :)


这篇关于是“DriveInfo.GetDrives()”一个windows api?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆