[英]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.