locked
C# Network class - Code Conversion RRS feed

  • Question

  • User-684585639 posted

    Can anyone convert these C# code to VB.NET

    NetworkChange.NetworkAddressChanged +=
    new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);

    void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
    {
    }

    Tuesday, September 20, 2011 7:05 AM

Answers

All replies

  • User-68639941 posted

    AddHandler NetworkChange.NetworkAddressChanged, AddressOf NetworkChange_NetworkAddressChanged

    Private Sub NetworkChange_NetworkAddressChanged(sender As Object, e As EventArgs)
    End Sub

    Refer : http://www.thescarms.com/dotnet/EventHandler.aspx

    http://devcity.net/Articles/25/1/20020316.aspx

     Refer : http://www.developerfusion.com/tools/convert/csharp-to-vb/

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 20, 2011 7:10 AM
  • User1992938117 posted

    Try this:

    NetworkChange.NetworkAddressChanged += New NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged)
    
    Private Sub NetworkChange_NetworkAddressChanged(sender As Object, e As EventArgs)
    End Sub
    Tuesday, September 20, 2011 7:12 AM
  • User-684585639 posted

    NetworkChange.NetworkAddressChanged += New NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged)

    Its not valid for VB.NET, it may be something like

    AddHandler NetworkChange, AddressOf - - -- - - -- - -

    Please help me.

    Tuesday, September 20, 2011 8:54 AM
  • User-684585639 posted

    AddHandler NetworkChange.NetworkAddressChanged, AddressOf NetworkChange_NetworkAddressChanged

    Private Sub NetworkChange_NetworkAddressChanged(sender As Object, e As EventArgs)
    End Sub

    Thanks its solve my problem.

    Tuesday, September 20, 2011 9:49 AM