SPDiagnosticsService.TypeName 属性
获取服务的友好名称。
命名空间: Microsoft.SharePoint.Administration
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Overrides ReadOnly Property TypeName As String
Get
用法
Dim instance As SPDiagnosticsService
Dim value As String
value = instance.TypeName
public override string TypeName { get; }
属性值
类型:System.String
String 包含本地化的名称。
备注
在英语中,则此属性返回"Windows SharePoint 诊断服务"。集中管理用户界面中,并在日志中使用的名称。
示例
下面的示例显示的控制台应用程序获取与该服务的实例相关联的各种名称,并将它们输出到控制台。
Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Administration
Module ConsoleApp
Sub Main()
Dim service As SPDiagnosticsService = SPDiagnosticsService.Local
If Not service Is Nothing Then
Console.WriteLine("DisplayName = {0} | Name = {1} | TypeName = {2}", _
service.DisplayName, service.Name, service.TypeName)
End If
Console.Write(vbCrLf + "Press ENTER to continue...")
Console.ReadLine()
End Sub
End Module
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
namespace Test
{
class ConsoleApp
{
static void Main(string[] args)
{
SPDiagnosticsService service = SPDiagnosticsService.Local;
if (service != null)
{
Console.WriteLine("DisplayName = {0} | Name = {1} | TypeName = {2}",
service.DisplayName, service.Name, service.TypeName);
}
Console.Write("\nPress ENTER to continue...");
Console.ReadLine();
}
}
}