c# - 从 windows 服务 c# 获取 Linux 服务器时间
问题描述
无论如何我可以从给定 linux 服务器 IP 的 windows 服务中获取 linux 服务器时间吗?我尝试使用 Cliwrap (https://github.com/Tyrrrz/CliWrap)并编写了以下函数,但它不能正常工作:
public string GetLinuxServerTime()
{
using (var cli = new Cli("bash.exe"))
{
// Execute
var output = cli.Execute("ssh user@10.104.12.114 date");
return "abc";
}
}
请建议一些其他方式。
解决方案
推荐阅读
- ansible - 如何使用单个任务在ansible中的同一目录中创建目录和文件
- c++ - 使用 Irrlicht 库时未定义的引用
- javascript - Tabulator 表上未显示复选框以选择行/多行
- perl - OTRS 创建票证时出现内部服务器错误
- javascript - 以 content_scripts 方式将 brython 注入网页
- sip - PJSUA:应用程序控制台上调试信息的详细程度
- geometry-surface - OpenCascade:带边界线的圆柱面
- visual-studio-code - VS Code Go to Symbol now(v1.42) 显示变量、对象和属性。如何定制?
- web-worker - 从 Quasar Framework 的 assets 目录加载一个 web worker
- html - 托管网站时图像对齐