How do I work with dial-up (RAS) connections in Windows using C#/.NET?

后端 未结 4 792
星月不相逢
星月不相逢 2021-01-06 01:26

I need to be able to connect, disconnect, and re-connect a dial-up networking connection in a C# .NET Framework application. Creating the connection in the phone-book might

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-06 01:43

    One way to do this is through Interop around RAS. RasDialDlg() can be used to open a dial-up networking connection without displaying the dialog box. Use RasHangUp() to disconnect.

    RasEnumConnections() can be used to list available connections.

    The dll is Rasapi32.dll - headers are in ras.h and raserror.h

提交回复
热议问题