1
Vote

Disconnection event arguments error

description

When used RasConnectionWatcher to watch connection change events, if i want to record connection duration when disconnect event arises, will be encountered an error.
private void Watcher_Disconnected(object sender, RasConnectionEventArgs e)
  {
            WriteLine($"Disconnected: {e.Connection.EntryName},duration: {e.Connection.GetConnectionStatistics().ConnectionDuration}");
        }
The vs debugger will tell me that the connection had been terminated. So if i can't get such information from RasConnectionEventArgs, why putting them in this type?

comments