简体   繁体   English

tftp' 不是内部或外部命令,也不是可运行的程序或批处理文件

[英]tftp' is not recognized as an internal or external command, operable program or batch file

I have been trying to transfer the files using the tftp in C#.我一直在尝试使用 C# 中的 tftp 传输文件。 I implemented it with the Process class.我用 Process 类实现了它。 I have turn on the TFTP client feature in Windows.我在 Windows 中打开了 TFTP 客户端功能。

This is the command -这是命令——

C:\Users\Desktop>tftp -i 192.168.43.171 put 
"C:\Users\cc\callisto\SampleTool\src\SampleTool\bin\Debug\DecryptedFiles\dserc.bin"
Transfer successful: 32 bytes in 1 second(s), 32 bytes/s

And the transfer is successful when I execute it manually But When I try it through the code, it says its not recognized -当我手动执行它时传输成功但是当我通过代码尝试它时,它说它无法识别 -

'tftp' is not recognized as an internal or external command,
 operable program or batch file.

Here is my code这是我的代码

public static void ExecuteCommand(string fileName, string command)
    {
        try
        {
            Process process = new Process();
            process.StartInfo.FileName = fileName;//cmd.exe
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.RedirectStandardInput = true;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.UseShellExecute = false;
            process.Start();
            process.StandardInput.WriteLine(command);//tftp command
            process.StandardInput.Flush();
            process.StandardInput.Close();
            process.WaitForExit();
        }
        catch (Exception ex)
        { }
    }

What is the exact issue I am facing.我面临的确切问题是什么。 Can anyone help谁能帮忙

Thanks.谢谢。

So after so much complication I found this link [https://github.com/Callisto82/tftp.net/blob/master/Tftp.Net.SampleClient/Program.cs]所以经过这么多的复杂,我找到了这个链接 [https://github.com/Callisto82/tftp.net/blob/master/Tftp.Net.SampleClient/Program.cs]

I was able to transfer the file successfully without any issue.我能够成功传输文件,没有任何问题。 Hopefully this helps希望这会有所帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将cmd命令识别为>内部或外部命令,可操作程序或批处理文件 - cmd command is not recognized as > an internal or external command, operable program or batch file Windows碎片整理无法识别为内部或外部命令,可操作程序或批处理文件 - Windows defrag is not recognized as an internal or external command, operable program or batch file VS2013的开发人员命令提示符-“”未被识别为内部或外部命令可操作程序或批处理文件 - developer command prompt for VS2013— “ ”is not recognized as an internal or external command operable program or batch file 创建jni4.jar文件时,它显示“ javac”未被识别为内部或外部命令,可操作程序或批处理文件 - When creating jni4.jar file, it shows 'javac' is not recognized as an internal or external command, operable program or batch file 不能将“ csc”识别为内部或外部cmd,可运行程序或批处理文件 - ''csc'' is not recognized as an internal or external cmd,operable program or batch file C#进程cmd.exe-无法将“ hadoop”识别为内部或外部命令,可操作程序或批处理文件 - C# Process cmd.exe - 'hadoop' is not recognized as an internal or external command, operable program or batch file 无法将“ C:\\ MPIHello \\ bin \\ Debug”识别为内部或外部命令,可操作程序或批处理文件 - 'C:\MPIHello\bin\Debug' is not recognized as an internal or external command, operable program or batch file 无法将“ java.exe”识别为内部或外部命令,可操作程序或批处理文件 - “java.exe” is not recognized as an internal or external command, operable program or batch file 如何解决“'installutil' 不是内部或外部命令、可运行程序或批处理文件。”? - How to resolve "'installutil' is not recognized as an internal or external command, operable program or batch file."? “C:Program”未被识别为内部或外部命令 - 'C:Program' not recognized as an internal or external command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM