【发布时间】:2020-03-17 19:56:59
【问题描述】:
我编写了一个 SFTP 连接,它连接到 .NET Core 中的安全域主机(MBox 位置):
IPHostEntry ip = Dns.GetHostEntry(Host);
using (SftpClient client = new SftpClient(ip.ToString(), Port, User, Password))
{
//connect to client
client.Connect();
var files = client.ListDirectory(PathToRead).ToList();
......
//wait for downloads to finish
await Task.WhenAll(tasks);
// disconnect the client by closing connection
client.Disconnect();
}
托管在 Azure 应用服务中,订阅和 Azure AD 根据我客户的域进行配置。当我运行代码时,我看到以下错误:
FTP 连接错误。异常:System.Net.Sockets.SocketException (11001):不知道这样的主机
你能帮忙吗?
【问题讨论】: