FtpClient.GetWorkingDirectory Method

System.Net.FtpClient

Collapse image Expand Image Copy image CopyHover image
Gets the current working directory

Namespace: System.Net.FtpClient
Assembly: System.Net.FtpClient (in System.Net.FtpClient.dll) Version: 1.0.5064.17461

Syntax

C#
public string GetWorkingDirectory()
Visual Basic
Public Function GetWorkingDirectory As String
Visual C++
public:
virtual String^ GetWorkingDirectory() sealed

Return Value

Type: String
The current working directory, ./ if the response couldn't be parsed.

Implements

IFtpClient..::..GetWorkingDirectory()()()()

Examples

C#  Copy imageCopy
using System;
using System.Net;
using System.Net.FtpClient;

namespace Examples {
    static class GetWorkingDirectoryExample {
        public static void GetWorkingDirectory() {
            using (FtpClient conn = new FtpClient()) {
                conn.Host = "localhost";
                conn.Credentials = new NetworkCredential("ftptest", "ftptest");
                Console.WriteLine("The working directory is: {0}",
                    conn.GetWorkingDirectory());
            }
        }
    }
}

See Also