ConnectionInfo.IconResource 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回 .resource 文件或 .resx 文件的名称,该文件包含在图形用户界面中表示此连接类型时要使用的图标。 此值为只读的。
public:
property System::String ^ IconResource { System::String ^ get(); };
public string IconResource { get; }
member this.IconResource : string
Public ReadOnly Property IconResource As String
属性值
一个字符串,其中包含 .resource 文件的名称或包含图标的 .resx 文件。
示例
下面的代码示例创建一个 Application 对象,循环访问计算机上的默认连接,然后列出每个连接的属性。 在此示例中,该 IconResource 示例显示为“0”。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace ConnInfoTest
{
class Program
{
static void Main(string[] args)
{
Application dtsApplication = new Application();
ConnectionInfos connectionInfos = dtsApplication.ConnectionInfos;
foreach (ConnectionInfo connInfo in connectionInfos)
{
Console.WriteLine(connInfo.ConnectionContact);
Console.WriteLine(connInfo.ConnectionType);
Console.WriteLine(connInfo.CreationName);
Console.WriteLine(connInfo.Description);
Console.WriteLine(connInfo.FileName);
//Console.WriteLine(connInfo.FileNameVersionString);
Console.WriteLine(connInfo.IconFile);
Console.WriteLine(connInfo.IconResource);
Console.WriteLine(connInfo.ID);
Console.WriteLine(connInfo.Name);
Console.WriteLine(connInfo.UITypeName);
}
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Namespace ConnInfoTest
Class Program
Shared Sub Main(ByVal args() As String)
Dim dtsApplication As Application = New Application()
Dim connectionInfos As ConnectionInfos = dtsApplication.ConnectionInfos
Dim connInfo As ConnectionInfo
For Each connInfo In connectionInfos
Console.WriteLine(connInfo.ConnectionContact)
Console.WriteLine(connInfo.ConnectionType)
Console.WriteLine(connInfo.CreationName)
Console.WriteLine(connInfo.Description)
Console.WriteLine(connInfo.FileName)
'Console.WriteLine(connInfo.FileNameVersionString)
Console.WriteLine(connInfo.IconFile)
Console.WriteLine(connInfo.IconResource)
Console.WriteLine(connInfo.ID)
Console.WriteLine(connInfo.Name)
Console.WriteLine(connInfo.UITypeName)
Next
End Sub
End Class
End Namespace
示例输出:
Microsoft Corporation
FILE
DTS.ConnectionManagerFile.1
Connection Manager for Files
C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DtsConn.dll
C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DtsConn.dll
0
{41F5EFE4-E91A-4EB0-BF10-D40FD48B3C03}
DTS Connection Manager for Files
Microsoft.DataTransformationServices.Design.SingleFileConnectionManagerUI,
Microsoft.DataTransformationServices.Design, Version=10.0.000.0,
Culture=neutral, PublicKeyToken=89845dcd8080cc91