RasDevice.GetDeviceByName Method (String, RasDeviceType, Boolean)

DotRas SDK

Collapse image Expand Image Copy image CopyHover image
Returns the first device matching the name and device type specified.

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

Syntax

C#
[ObsoleteAttribute("This method will be removed in a future version, please use the GetDevices method to find the devices.", 
	false)]
public static RasDevice GetDeviceByName(
	string name,
	RasDeviceType deviceType,
	bool exactMatchOnly
)
Visual Basic
<ObsoleteAttribute("This method will be removed in a future version, please use the GetDevices method to find the devices.", 
	false)> 
Public Shared Function GetDeviceByName ( 
	name As String,
	deviceType As RasDeviceType,
	exactMatchOnly As Boolean
) As RasDevice
Visual C++
public:
[ObsoleteAttribute(L"This method will be removed in a future version, please use the GetDevices method to find the devices.", 
	false)]
static RasDevice^ GetDeviceByName(
	String^ name, 
	RasDeviceType deviceType, 
	bool exactMatchOnly
)
F#
[<ObsoleteAttribute("This method will be removed in a future version, please use the GetDevices method to find the devices.", 
	false)>]
static member GetDeviceByName : 
        name : string * 
        deviceType : RasDeviceType * 
        exactMatchOnly : bool -> RasDevice 

Parameters

name
Type: System..::..String
The name (or partial name) of the device to retrieve.
deviceType
Type: DotRas..::..RasDeviceType
The RasDeviceType of the device to retrieve.
exactMatchOnly
Type: System..::..Boolean
true if the name should be matched exactly; false to allow partial matching.

Return Value

Type: RasDevice
The RasDevice if available, otherwise a null reference (Nothing in Visual Basic).

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