Attempting to GetActiveConnections method is not recognized

Mar 8, 2011 at 8:06 AM

hi Jeff!

 

in another discussion result I found via google, I wanted to use this code (slightly modified):

 

                //Look for active connection
                RasDialer dialer2 = new RasDialer();
                foreach (RasConnection connection in dialer2.GetActiveConnections())
                {
                    if (connection.EntryName == "VPN1")
                    {
                        this.handle = connection.Handle;
                        this.DisconnectButton = true;
                        this.DialButton = false;
                        break;
                    }
                }

 

I am getting the error: Error 6 'DotRas.RasDialer' does not contain a definition for 'GetActiveConnections' and no extension method 'GetActiveConnections' accepting a first argument of type 'DotRas.RasDialer' could be found (are you missing a using directive or an assembly reference?)

 

And indeed Intellisense doesn't show any such function available for the RasDialer class... was that function removed/renamed at some point?

Coordinator
Mar 8, 2011 at 5:39 PM

It was moved a while ago, the new location (and the place it will remain) is RasConnection.GetActiveConnections() - the method works the same, it just didn't make any sense to put it on the dialer when it had nothing to do with that particular functionality, either internally or externally.

Mar 10, 2011 at 6:09 PM

Thank you Jeff!

 

Not just for the post here but all your help over the forum, we have finished our project, and works perfectly the way we wanted now :)

Coordinator
Mar 10, 2011 at 9:31 PM

Not a problem. I'm glad to hear your project worked out like you wanted. Happy coding!

- Jeff