简体   繁体   English

这是什么路?

[英]What is this kind of path?

I got some path while working on a project but not able to figure out the kind of it. 在进行项目时,我有一些方法,但无法弄清楚它的种类。 What is this and how can I access it. 这是什么,我如何访问它。 if you know please share... 如果您知道,请分享...

const string WmiNamespace_2005 = @"\\.\root\Microsoft\SqlServer\ReportServer\v9\Admin";
const string WmiRSClass_2005 = @"\\.\root\Microsoft\SqlServer\ReportServer\v9\Admin:MSReportServer_ConfigurationSetting";

const string WmiNamespace_2008 = @"\\.\root\Microsoft\SqlServer\ReportServer\{0}\v10\Admin";
const string WmiRSClass_2008 = @"\\.\root\Microsoft\SqlServer\ReportServer\{0}\v10\Admin:MSReportServer_ConfigurationSetting";

const string WmiNamespaceToUse = "root\\Microsoft\\SqlServer\\ReportServer";

It is used for finding out the installed instances of SQL Server, but I am confused in these paths only.. 它用于查找SQL Server的已安装实例,但是我仅对这些路径感到困惑。

This is a WMI Object Path . 这是WMI对象路径

Conceptually similar to a Uniform Resource Locator (URL), a WMI object path is a string that uniquely identifies the namespace on a server, a class within a namespace, or instances of a class. WMI对象路径在概念上类似于统一资源定位器(URL),是一个字符串,用于唯一标识服务器上的名称空间,名称空间中的类或类的实例。 An object path is hierarchical, and contains several elements that describe the location of the object in question. 对象路径是分层的,并且包含描述所讨论对象位置的多个元素。 Like file paths, WMI object paths can be described in full or specified as a relative path 与文件路径一样,WMI对象路径可以完整描述,也可以指定为相对路径

EDIT: WMI Object Path Requirements 编辑:WMI对象路径要求

From MSDN: 从MSDN:

An object path can use the following syntax: 对象路径可以使用以下语法:

  • Strings contained in single quotation marks. 单引号中包含的字符串。
  • Forward slashes as separators. 正斜杠作为分隔符。
  • Backslashes as separators. 反斜杠作为分隔符。
  • Hexadecimal constants for integers. 整数的十六进制常数。
  • Boolean constants for classes with keys that take Boolean values. 具有带有布尔值的键的类的布尔常量。
  • URL notation to represent nonprinting characters, such as %20 for a blank space. 表示非打印字符的URL表示法,例如%20表示空格。

In addition, an object path string must obey the following restrictions: 另外,对象路径字符串必须遵守以下限制:

  • An assumed local server with a partial namespace path. 假定的本地服务器具有部分名称空间路径。 Thus, specifying the root and default namespace implies the root and default namespace on the local server. 因此,指定root和default命名空间意味着本地服务器上的root和default命名空间。
  • No white space either within an element or between elements. 元素内或元素之间没有空格。
  • Embedded quotation marks in object paths are allowed but must delimit the quotation mark with escape characters, as in a C or C++ application. 允许在对象路径中嵌入引号,但必须在C或C ++应用程序中使用转义字符来分隔引号。
  • Only decimal values are recognized as numeric portions of keys. 只有十进制值被识别为键的数字部分。

These are Windows Management Instrumentation paths. 这些是Windows Management Instrumentation路径。 WMI provides a general API for management (in this case SQL Server). WMI提供了用于管理的常规API(在本例中为SQL Server)。 You address the management objects by namespaces that are similar to file system paths except they don't point to files but to management objects that can be queried and used to control whatever they are managing. 您可以通过类似于文件系统路径的名称空间来管理对象,只是它们不指向文件而是指向可以查询并用来控制其管理内容的管理对象。

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

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