Find Jobs
Hire Freelancers

Console App With Renci.SSH

$10-30 USD

クローズ
投稿日: 5年以上前

$10-30 USD

完了時にお支払い
Good day all - I have a C# console application that connects via [login to view URL] to a Unix server and downloads the files from the Unix Server. The issue I face is that when the directory on the Unix Server contains a folder, my code errors out. What I want... I need the below code to be updated to download 1) All files in the parent directory (already does this) 2) All folders and sub-folders (including any files) -- I NEED THIS Below is my current syntax: private static void DownloadFile(string arc, string username, string password) { string fullpath; string fp; var options = new ProgressBarOptions { ProgressCharacter = '.', ProgressBarOnBottom = true }; using (var sftp = new SftpClient(Host, username, password)) { [login to view URL](); fp = RemoteDir + "/" + arc; if ([login to view URL](fp)) fullpath = fp; else fullpath = SecondaryRemoteDir + d + "/" + arc; if ([login to view URL](fullpath)) { var files = [login to view URL](fullpath); foreach (var file in files) { if ([login to view URL]().Substring(0, 1) != ".") { [login to view URL]("Downloading file from the server..."); [login to view URL](); using (var pbar = new ProgressBar(100, "Downloading " + [login to view URL] + "....", options)) { SftpFileAttributes att = [login to view URL](fullpath + "/" + [login to view URL]); var fileSize = [login to view URL]; var ms = new MemoryStream(); IAsyncResult asyncr = [login to view URL](fullpath + "/" + [login to view URL], ms); SftpDownloadAsyncResult sftpAsyncr = (SftpDownloadAsyncResult)asyncr; int lastpct = 0; while (![login to view URL]) { int pct = (int)((long)[login to view URL] / fileSize) * 100; if (pct > lastpct) for (int i = 1; i < pct - lastpct; i++) [login to view URL](); } [login to view URL](asyncr); [login to view URL]("Writing File to disk..."); [login to view URL](); string localFilePath = "C:\" + [login to view URL]; var fs = new FileStream(localFilePath, [login to view URL], [login to view URL]); [login to view URL](fs); [login to view URL](); [login to view URL](); } } } } else { [login to view URL]("The arc " + arc + " with a date of " + d + " does not exist at either location of 1) " + RemoteDir + " or 2) " + SecondaryRemoteDir); [login to view URL](); [login to view URL]("Please press any key to close this window"); [login to view URL](); } } }
プロジェクト ID: 17802658

プロジェクトについて

2個の提案
リモートプロジェクト
アクティブ 5年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
この仕事に2人のフリーランサーが、平均$23 USDで入札しています
ユーザーアバター
Easy to fix just needs recursion.
$10 USD 3日以内
0.0 (0 レビュー)
0.0
0.0
ユーザーアバター
Hello. I can do that job for you.
$35 USD 1日以内
0.0 (0 レビュー)
0.0
0.0

クライアントについて

UNITED STATESのフラグ
Athens, United States
0.0
0
メンバー登録日:9月 19, 2018

クライアント確認

ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。