DirectoryInfo.ToString Method

Definition

Returns the original path that was passed to the DirectoryInfo constructor. Use the FullName or Name properties for the full path or file/directory name instead of this method.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Returns

The original path that was passed by the user.

Remarks

Important

The string returned by the ToString method represents the path that was passed to the DirectoryInfo constructor. Instead of calling the ToString method, you should retrieve the value of either of the following properties, depending on your intent:

  • Name, to get the name of the directory, without any parent path information.
  • FullName, to get the fully qualified path of the directory.

Applies to

See also