问题描述
我一直在尝试使用C#中的tftp传输文件。 我用Process类实现了它。 我已经在Windows中打开了TFTP客户端功能。
这是命令-
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
当我手动执行转移时,转移成功 但是当我通过代码尝试时,它说它未被识别-
'tftp' is not recognized as an internal or external command,operable program or batch file.
这是我的代码
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)
{ }
}
我要面对的确切问题是什么?谁能帮忙
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)