BreakpointTarget.HitCount 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個整數,指定在執行時引擎暫停前斷點出現的次數。
public:
property int HitCount { int get(); };
public int HitCount { get; }
member this.HitCount : int
Public ReadOnly Property HitCount As Integer
屬性值
一個整數,包含斷點在運行時引擎暫停前出現的次數。
範例
以下程式碼範例從套件中取得斷點目標集合,並遍歷中斷點,顯示每個斷點的屬性,包括 HitCount。
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;
namespace Breakpoint_API
{
class Program
{
static void Main(string[] args)
{
Package pkg = new Package();
TaskHost taskHost = (TaskHost)pkg.Executables.Add("STOCK:FileSystemTask");
BreakpointTargets bptargets = pkg.GetBreakpointTargets(taskHost, false);
foreach (BreakpointTarget bpt in bptargets)
{
Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString());
Console.WriteLine("Description {0}", bpt.Description);
Console.WriteLine("Enabled? {0}", bpt.Enabled);
Console.WriteLine("HitCount {0}", bpt.HitCount);
Console.WriteLine("HitTarget {0}", bpt.HitTarget);
Console.WriteLine("HitTest {0}", bpt.HitTest);
Console.WriteLine("ID {0}", bpt.ID);
Console.WriteLine("Owner {0}", bpt.Owner);
}
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask
Namespace Breakpoint_API
Class Program
Shared Sub Main(ByVal args() As String)
Dim pkg As Package = New Package()
Dim taskHost As TaskHost = CType(pkg.Executables.Add("STOCK:FileSystemTask"), TaskHost)
Dim bptargets As BreakpointTargets = pkg.GetBreakpointTargets(taskHost,False)
Dim bpt As BreakpointTarget
For Each bpt In bptargets
Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString())
Console.WriteLine("Description {0}", bpt.Description)
Console.WriteLine("Enabled? {0}", bpt.Enabled)
Console.WriteLine("HitCount {0}", bpt.HitCount)
Console.WriteLine("HitTarget {0}", bpt.HitTarget)
Console.WriteLine("HitTest {0}", bpt.HitTest)
Console.WriteLine("ID {0}", bpt.ID)
Console.WriteLine("Owner {0}", bpt.Owner)
Next
End Sub
End Class
End Namespace
範例輸出:
表情變化的崩潰? 否
說明 當容器收到 OnPreExecute 事件時會中斷
已啟用? 否
命中次數 0
命中目標 0
HitTest 永遠
身分證 -2147483647
擁有者是 Microsoft。SqlServer.Dts.Runtime.TaskHost
備註
欲了解更多如何在使用者介面設定命中次數的資訊,請參閱「 透過設定任務或容器的斷點來除錯套件」。