RasDevice.Create Method

DotRas SDK

Collapse image Expand Image Copy image CopyHover image
Creates a new device. WARNING: This method does not guarantee the hardware will be installed.

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

Syntax

C#
public static RasDevice Create(
	string name,
	RasDeviceType deviceType
)
Visual Basic
Public Shared Function Create ( 
	name As String,
	deviceType As RasDeviceType
) As RasDevice
Visual C++
public:
static RasDevice^ Create(
	String^ name, 
	RasDeviceType deviceType
)
F#
static member Create : 
        name : string * 
        deviceType : RasDeviceType -> RasDevice 

Parameters

name
Type: System..::..String
Required. The name of the device.
deviceType
Type: DotRas..::..RasDeviceType
Required. The RasDeviceType indicating the type of device.

Return Value

Type: RasDevice
A new RasDevice object.

Remarks

This method essentially creates hardware on machines that may not exist and is exposed due to problems when hardware is installed and not recognized immediately by the remote access service. Using this method does not guarantee the hardware will be installed and may cause the machine to crash when the entry is dialed.

Exceptions

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

See Also