Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than rasapi32, prefix the name with the module name and a period.
RasSetEntryProperties (rasapi32)
.
C# Signature:
/// <summary>
/// Changes the connection information for an entry in the phone book or creates a new phone-book entry.
/// </summary>
/// <param name="lpszPhonebook">Pointer to a null-terminated string that specifies the full path and file name of a phone-book (PBK) file.
/// If this parameter is NULL, the function uses the current default phone-book file.</param>
/// <param name="lpszEntry">Pointer to a null-terminated string that specifies an entry name.
/// If the entry name matches an existing entry, RasSetEntryProperties modifies the properties of that entry.
/// If the entry name does not match an existing entry, RasSetEntryProperties creates a new phone-book entry.</param>
/// <param name="lpRasEntry">Pointer to the RASENTRY structure that specifies the connection data to associate with the phone-book entry.</param>
/// <param name="dwEntryInfoSize">Specifies the size, in bytes, of the buffer identified by the lpRasEntry parameter.</param>
/// <param name="lpbDeviceInfo">This parameter is unused. The calling function should set this parameter to NULL.</param>
/// <param name="dwDeviceInfoSize">This parameter is unused. The calling function should set this parameter to zero.</param>
/// <returns></returns>
[DllImport("rasapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern Uint RasSetEntryProperties(
string lpszPhonebook,
string lpszEntry,
ref RASENTRY lpRasEntry,
int dwEntryInfoSize,
IntPtr lpbDeviceInfo,
int dwDeviceInfoSize);
VB Signature:
Declare Function RasSetEntryProperties Lib "rasapi32.dll" (TODO) As TODO
User-Defined Types:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 4)]
public struct RASENTRY
{
public int dwSize;
public int dwfOptions;
public int dwCountryID;
public int dwCountryCode;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxAreaCode+1)]
public string szAreaCode;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxPhoneNumber+1)]
public string szLocalPhoneNumber;
public int dwAlternateOffset;
public RASIPADDR ipaddr;
public RASIPADDR ipaddrDns;
public RASIPADDR ipaddrDnsAlt;
public RASIPADDR ipaddrWins;
public RASIPADDR ipaddrWinsAlt;
public int dwFrameSize;
public int dwfNetProtocols;
public int dwFramingProtocol;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) MAX_PATH)]
public string szScript;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) MAX_PATH)]
public string szAutodialDll;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) MAX_PATH)]
public string szAutodialFunc;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxDeviceType + 1)]
public string szDeviceType;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxDeviceName + 1)]
public string szDeviceName;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxPadType + 1)]
public string szX25PadType;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxX25Address + 1)]
public string szX25Address;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxFacilities + 1)]
public string szX25Facilities;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxUserData + 1)]
public string szX25UserData;
public int dwChannels;
public int dwReserved1;
public int dwReserved2;
public int dwSubEntries;
public int dwDialMode;
public int dwDialExtraPercent;
public int dwDialExtraSampleSeconds;
public int dwHangUpExtraPercent;
public int dwHangUpExtraSampleSeconds;
public int dwIdleDisconnectSeconds;
public int dwType;
public int dwEncryptionType;
public int dwCustomAuthKey;
public Guid guidId;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) MAX_PATH)]
public string szCustomDialDll;
public int dwVpnStrategy;
public int dwfOptions2;
public int dwfOptions3;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxDnsSuffix)]
public string szDnsSuffix;
public int dwTcpWindowSize;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) MAX_PATH)]
public string szPrerequisitePbk;
[MarshalAs(UnmanagedType.ByValTStr,SizeConst =
(int) RasFieldSizeConstants.RAS_MaxEntryName)]
public string szPrerequisiteEntry;
public int dwRedialCount;
public int dwRedialPause;
RASIPV6ADDR ipv6addrDns;
RASIPV6ADDR ipv6addrDnsAlt;
public int dwIPv4InterfaceMetric;
public int dwIPv6InterfaceMetric;
RASIPV6ADDR ipv6addr;
public int dwIPv6PrefixLength;
public int dwNetworkOutageTime;
}
/// <summary>
/// Create or modify network connection.
/// </summary>
/// <param name="connectionName">Name of the network connection to create or modify.</param>
/// <param name="rasEntryStructure">RASENTRY structure containing connection settings.</param>
/// <returns>Enumerated RASERROR</returns>
public static RasError SetEntryProperties(string connectionName, RASENTRY rasEntryStructure)
{
return (RasError)RasSetEntryProperties(null, connectionName, ref rasEntryStructure, Marshal.SizeOf(rasEntryStructure), IntPtr.Zero, 0);
}
The RasSetEntryProperties function changes the connection information for an entry in the phone book or creates a new phone-book entry.
7/14/2015 5:04:47 AM - colmde@hotmail.com-178.250.116.242
TODO - a short description
11/17/2009 2:58:19 PM - -70.141.226.22
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).