RasDialDlg (rasapi32)
Last changed: -216.77.229.132

.
Summary
The RasDialDlg function establishes a RAS connection using a specified phone-book entry and the credentials of the logged-on user. The function displays a stream of dialog boxes that indicate the state of the connection operation.

C# Signature:

[DllImport("Rasdlg.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern bool RasDialDlg(
    IntPtr phoneBook,
    string entryName,
    IntPtr phoneNumber,
    ref RASDIALDLG info);

VB Signature:

TODO

User-Defined Types:

RASDIALDLG Struct

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

I don't use phoneBook and phoneNumber, so they are as IntPtr.
Please check my English !

Tips & Tricks:

Please add some!

Sample Code:

RASDIALDLG info = new RASDIALDLG();
info.dwSize = Marshal.SizeOf(info);
bool ret = RAW.RasDialDlg(IntPtr.Zero, "Some Connection Name", IntPtr.Zero, ref info);
if (ret == false && info.dwError != ERROR_SUCCESS)
    throw new Win32Exception(info.dwError);

Documentation
RasDialDlg on MSDN