4
是否正常firebird服務器發送所有註冊的事件計數提高任何註冊事件?Firebird發送.NET中的所有事件
例如在火鳥網站我這樣做:
class FirebirdListenerTest
{
public FirebirdListenerTest()
{
try
{
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
cs.DataSource = "localhost";
cs.Database = "C:\\FIREBIRD\\TEST.GDB";
cs.UserID = "SYSDBA";
cs.Password = "masterkey";
cs.Charset = "NONE";
FbConnection connection = new FbConnection(cs.ToString());
connection.Open();
FbRemoteEvent revent = new FbRemoteEvent(connection);
revent.AddEvents(new string[] { "text_changed", "text_inserted", "justtest_event" });
// Add callback to the Firebird events
revent.RemoteEventCounts += new FbRemoteEventEventHandler(EventCounts);
// Queue events
revent.QueueEvents();
Console.ReadLine();
connection.Close();
}
catch (Exception e)
{
Debug.WriteLine(e.ToString());
}
}
static void EventCounts(object sender, FbRemoteEventEventArgs args)
{
Console.WriteLine("Event {0} has {1} counts.", args.Name, args.Counts);
}
}
在這樣的代碼,如果任何事件的提高,我總是對所有事件計數。它是如何工作的?
我這樣做就像你描述的一樣。我想確定。謝謝。 – Fanda