コード例 #1
0
ファイル: BeginRename.cs プロジェクト: fanpan26/Macrosage.Wx
        public static void BeginRename() {
            // The using statement here is OK _only_ because m_reset.WaitOne()
            // causes the code to block until the async process finishes, otherwise
            // the connection object would be disposed early. In practice, you
            // typically would not wrap the following code with a using statement.
            using (FtpClient conn = new FtpClient()) {
                m_reset.Reset();
                
                conn.Host = "localhost";
                conn.Credentials = new NetworkCredential("ftptest", "ftptest");
                conn.BeginRename("/source/object", "/new/path/and/name",
                    new AsyncCallback(BeginRenameCallback), conn);

                m_reset.WaitOne();
                conn.Disconnect();
            }
        }
コード例 #2
0
ファイル: BeginRename.cs プロジェクト: zeroandy/FluentFTP
        public static void BeginRename()
        {
            // The using statement here is OK _only_ because m_reset.WaitOne()
            // causes the code to block until the async process finishes, otherwise
            // the connection object would be disposed early. In practice, you
            // typically would not wrap the following code with a using statement.
            using (FtpClient conn = new FtpClient()) {
                m_reset.Reset();

                conn.Host        = "localhost";
                conn.Credentials = new NetworkCredential("ftptest", "ftptest");
                conn.BeginRename("/source/object", "/new/path/and/name",
                                 new AsyncCallback(BeginRenameCallback), conn);

                m_reset.WaitOne();
                conn.Disconnect();
            }
        }