Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Aspera错误:-ascp.exe:无法打开SSH的TCP连接,正在退出_C#_Ssh_Console Application - Fatal编程技术网

C# Aspera错误:-ascp.exe:无法打开SSH的TCP连接,正在退出

C# Aspera错误:-ascp.exe:无法打开SSH的TCP连接,正在退出,c#,ssh,console-application,C#,Ssh,Console Application,我正在使用Aspera文件上载功能,根据下面的场景,我得到一个错误 我从下面的URL下载了Aspera CLI。 然后在命令提示符的帮助下运行下面的语句,它工作得很好 cmd语句:ascp-P33001-QT-l500m--filemanifest=text-k0-o 覆盖=始终{源文件路径}{用户名}@{domain}:{目标 文件夹} 它工作得非常好 然后我用下面的代码从控制台应用程序中尝试了同样的方法 Process process = new Process();

我正在使用Aspera文件上载功能,根据下面的场景,我得到一个错误

我从下面的URL下载了Aspera CLI。

然后在命令提示符的帮助下运行下面的语句,它工作得很好

cmd语句:ascp-P33001-QT-l500m--filemanifest=text-k0-o 覆盖=始终{源文件路径}{用户名}@{domain}:{目标 文件夹}

它工作得非常好

然后我用下面的代码从控制台应用程序中尝试了同样的方法

Process process = new Process();
                process.StartInfo.FileName = @"E:\Projects\Research\AsperaFileUpload\AsperaFileUpload\AsperaLibrary\bin\ascp.exe";
                process.StartInfo.Arguments = @"ascp -P33001 -QT -l500m --file-manifest=text -k 0 -o Overwrite=always {Source File Path} {username}@{domain}:{destination Folder}"; // Note the /c command (*)

                process.StartInfo.UseShellExecute = false;
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.RedirectStandardError = true;
                process.Start();
                //* Read the output (or the error)
                string output = process.StandardOutput.ReadToEnd();
                Console.WriteLine(output); 
                string err = process.StandardError.ReadToEnd();
                Console.WriteLine(err);
                Console.ReadLine();
                process.WaitForExit();
但此代码总是给出类似“ascp.exe:无法打开SSH的TCP连接,正在退出”的错误

我想知道同一个命令是否可以从命令行运行,为什么它不能从控制台应用程序运行

谁能帮我一下吗


提前感谢。

此错误消息告知“ascp”无法连接到服务器“{domain}”的TCP端口33001(arg“-p”)

我建议如下:

  • 使用更现代的语法:

    ascp -P33001 -QT -l500m --file-manifest=text -k 0 -o Overwrite=always --host={domain} --user={username} --mode=send {Source File Path} {destination Folder}
    
  • 添加参数
    -L/path/to/log/folder
    ,并查看文件aspera-scp-transfer.log中的日志错误

  • 您会发现,与其使用裸的“ascp”,不如在此处使用“TransferSDK”: