是否可以通过 C# 代码执行 运行 CLI(命令行界面)命令

is it possible to run CLI(command line interface) commands through C# code

上传文件到存储桶

syn: aws s3 cp [FilePath\FileName] s3://[BucketName]

我已通过 cmd 执行上述命令,将文件上传到 S3 存储桶。现在我需要如何使用 C# 代码将文件上传到 s3 存储桶。可以吗?

提前致谢。

AWS 提供 SDK for C#, which you must ideally use for such things. Even though you could do what you're asking for using CLI within C#, your work becomes un-necessary complex. You can check this answer 如何在 C# 中 运行 命令。