RasEntry.CreateVpnEntry Method (String, String, RasVpnStrategy, RasDevice, Boolean)

DotRas SDK

Collapse image Expand Image Copy image CopyHover image
Creates a new virtual private network (VPN) entry.

Namespace: DotRas
Assembly: DotRas (in DotRas.dll) Version: 1.3.5166.33435 (1.3.0.0)

Syntax

C#
public static RasEntry CreateVpnEntry(
	string name,
	string serverAddress,
	RasVpnStrategy strategy,
	RasDevice device,
	bool useRemoteDefaultGateway
)
Visual Basic
Public Shared Function CreateVpnEntry ( 
	name As String,
	serverAddress As String,
	strategy As RasVpnStrategy,
	device As RasDevice,
	useRemoteDefaultGateway As Boolean
) As RasEntry
Visual C++
public:
static RasEntry^ CreateVpnEntry(
	String^ name, 
	String^ serverAddress, 
	RasVpnStrategy strategy, 
	RasDevice^ device, 
	bool useRemoteDefaultGateway
)
F#
static member CreateVpnEntry : 
        name : string * 
        serverAddress : string * 
        strategy : RasVpnStrategy * 
        device : RasDevice * 
        useRemoteDefaultGateway : bool -> RasEntry 

Parameters

name
Type: System..::..String
The name of the entry.
serverAddress
Type: System..::..String
The server address to connect to.
strategy
Type: DotRas..::..RasVpnStrategy
The virtual private network (VPN) strategy of the connection.
device
Type: DotRas..::..RasDevice
Required. An RasDevice to use for connecting.
useRemoteDefaultGateway
Type: System..::..Boolean
true if the connection should use the remote default gateway, otherwise false.

Return Value

Type: RasEntry
A new RasEntry object.

Remarks

The device for this connection is typically a WAN Miniport (L2TP) or WAN Miniport (PPTP).

Exceptions

Exception Condition
System..::..ArgumentException name or serverAddress is an empty string or null reference (Nothing in Visual Basic).
System..::..ArgumentNullException device is a null reference (Nothing in Visual Basic).

See Also