Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c#Windows 10 WebRequest和FTP_C#_Ftp_Windows 10_Webrequest - Fatal编程技术网

c#Windows 10 WebRequest和FTP

c#Windows 10 WebRequest和FTP,c#,ftp,windows-10,webrequest,C#,Ftp,Windows 10,Webrequest,希望有人能帮我 我在Windows 8上使用这段代码时没有遇到任何问题: WebRequest request = WebRequest.Create("ftp://192.168.100.42/FolderName/"); request.Method = "NLST"; request.Credentials = credential; using (WebResponse response = await request.GetResponseAsync()) {

希望有人能帮我

我在Windows 8上使用这段代码时没有遇到任何问题:

  WebRequest request = WebRequest.Create("ftp://192.168.100.42/FolderName/");
  request.Method = "NLST";
  request.Credentials = credential;
  using (WebResponse response = await request.GetResponseAsync())
  {
      // Irrevelant operations (storing file names)
  }
在Windows 10 universal app上,GetResponseAsync方法引发异常:

“只允许使用“http”和“https”方案。\r\n参数名称: 请求URI“

唯一相对类似的主题是:


同样通过WebRequest使用FTP请求(FtpWebRequest不再可用),但他的错误是专门针对上传的。

看起来解决方案是一样的,“这让你可以通过套接字实现自己的FTP协议。”是的,我看到了。有点希望找到其他解决方案。实际上,这是一个完全相同的解决方案,因为在这两种情况下,它都是
WebRequest.Create(“ftp://...
这就是失败的原因看起来解决方案是一样的,“这让您可以通过套接字实现自己的FTP协议。“是的,我看到了。有点希望找到其他解决方案。实际上,这是一个完全相同的解决方案,因为在这两种情况下,它都是
WebRequest。Create(”ftp://...
这是失败的