RasEntry.Exists Method

DotRas SDK

Collapse image Expand Image Copy image CopyHover image
Determines whether an entry exists within the phone book at the path specified.

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

Syntax

C#
public static bool Exists(
	string entryName,
	string phoneBookPath
)
Visual Basic
Public Shared Function Exists ( 
	entryName As String,
	phoneBookPath As String
) As Boolean
Visual C++
public:
static bool Exists(
	String^ entryName, 
	String^ phoneBookPath
)
F#
static member Exists : 
        entryName : string * 
        phoneBookPath : string -> bool 

Parameters

entryName
Type: System..::..String
The name of the entry to check.
phoneBookPath
Type: System..::..String
The full path (including filename) of the phone book.

Return Value

Type: Boolean
true if the entry exists, otherwise false.

Examples

The following example shows how to test whether an entry exists within a phone book.
C# Copy imageCopy
bool exists = RasEntry.Exists("VPN Connection", "C:\\MyPhoneBook.pbk");
Visual Basic Copy imageCopy
Dim exists As Boolean = RasEntry.Exists("VPN Connection", "C:\MyPhoneBook.pbk")

Exceptions

Exception Condition
System..::..ArgumentException entryName and/or phoneBookPath is an empty string or null reference (Nothing in Visual Basic).
System.IO..::..FileNotFoundException phoneBookPath was not found.

See Also