<bdo id='I92ih'></bdo><ul id='I92ih'></ul>
    1. <small id='I92ih'></small><noframes id='I92ih'>

      <tfoot id='I92ih'></tfoot>

    2. <legend id='I92ih'><style id='I92ih'><dir id='I92ih'><q id='I92ih'></q></dir></style></legend>
        <i id='I92ih'><tr id='I92ih'><dt id='I92ih'><q id='I92ih'><span id='I92ih'><b id='I92ih'><form id='I92ih'><ins id='I92ih'></ins><ul id='I92ih'></ul><sub id='I92ih'></sub></form><legend id='I92ih'></legend><bdo id='I92ih'><pre id='I92ih'><center id='I92ih'></center></pre></bdo></b><th id='I92ih'></th></span></q></dt></tr></i><div id='I92ih'><tfoot id='I92ih'></tfoot><dl id='I92ih'><fieldset id='I92ih'></fieldset></dl></div>
      1. Windows 10 通用应用程序中的 C# Ftp 上传?

        时间:2023-09-14
          <tbody id='sSWvc'></tbody>

      2. <tfoot id='sSWvc'></tfoot>

        • <small id='sSWvc'></small><noframes id='sSWvc'>

            <i id='sSWvc'><tr id='sSWvc'><dt id='sSWvc'><q id='sSWvc'><span id='sSWvc'><b id='sSWvc'><form id='sSWvc'><ins id='sSWvc'></ins><ul id='sSWvc'></ul><sub id='sSWvc'></sub></form><legend id='sSWvc'></legend><bdo id='sSWvc'><pre id='sSWvc'><center id='sSWvc'></center></pre></bdo></b><th id='sSWvc'></th></span></q></dt></tr></i><div id='sSWvc'><tfoot id='sSWvc'></tfoot><dl id='sSWvc'><fieldset id='sSWvc'></fieldset></dl></div>
          1. <legend id='sSWvc'><style id='sSWvc'><dir id='sSWvc'><q id='sSWvc'></q></dir></style></legend>
              <bdo id='sSWvc'></bdo><ul id='sSWvc'></ul>

                1. 本文介绍了Windows 10 通用应用程序中的 C# Ftp 上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想使用 ftp 从 Windows 10 应用程序上传文件,我尝试了以下代码.

                  I want to upload files from windows 10 app using ftp, I tried the following code.

                      using System;
                      using System.IO;
                      using System.Net;
                      using System.Text;
                  
                      namespace Examples.System.Net
                      {
                          public class WebRequestGetExample
                          {
                              public static void Main ()
                              {
                          // Get the object used to communicate with the server.
                                  FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.contoso.com/test.htm");
                          request.Method = WebRequestMethods.Ftp.UploadFile;
                  
                          // This example assumes the FTP site uses anonymous logon.
                          request.Credentials = new NetworkCredential ("anonymous","janeDoe@contoso.com");
                  
                          // Copy the contents of the file to the request stream.
                          StreamReader sourceStream = new StreamReader("testfile.txt");
                          byte [] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
                          sourceStream.Close();
                          request.ContentLength = fileContents.Length;
                  
                          Stream requestStream = request.GetRequestStream();
                          requestStream.Write(fileContents, 0, fileContents.Length);
                          requestStream.Close();
                  
                          FtpWebResponse response = (FtpWebResponse)request.GetResponse();
                  
                          Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
                  
                          response.Close();
                          }
                      }
                          }
                      }
                  

                  但 Visual Studio 找不到名称空间 FtpWebRequestWebRequestMethods.我尝试使用 link 但它说 WinRT information: 'uri': 上传内容仅支持 'http' 和 'https' 方案. 不支持 ftp.

                  But visual studio couldn't find the name space FtpWebRequest or WebRequestMethods. The other method i tried using backgroundtransfer api's from link but it says that WinRT information: 'uri': Uploading content is only supported for 'http' and 'https' schemes. not ftp.

                  那么有什么解决方案可以显示进度条和速度吗?

                  So is there any solution to this where i can show progress bar and speed?

                  推荐答案

                  FtpWebRequest 类不是 UWP 应用商店配置文件的一部分,并且不支持通过 BackgroundTransfer API 进行 FTP 上传(如您所确定).这使您可以通过套接字实现自己的 FTP 协议.请参阅 WinRT 中的 FTP Endeavor 了解说明和一个样本的链接.

                  The FtpWebRequest class is not part of the store profile for UWP apps, and FTP upload (as you determined) is not supported via the BackgroundTransfer API. This leave you with implementing your own FTP protocol over sockets. See FTP Endeavor in WinRT for an explanation and a link to a sample.

                  这篇关于Windows 10 通用应用程序中的 C# Ftp 上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 Windows 10 上安装 OpenXML SDK 生产力工具 2.5 下一篇:如何使 EntranceThemeTransition 在自定义面板上工作项目来源?

                  相关文章

                2. <tfoot id='eTsgn'></tfoot>

                    • <bdo id='eTsgn'></bdo><ul id='eTsgn'></ul>

                    <small id='eTsgn'></small><noframes id='eTsgn'>

                  1. <i id='eTsgn'><tr id='eTsgn'><dt id='eTsgn'><q id='eTsgn'><span id='eTsgn'><b id='eTsgn'><form id='eTsgn'><ins id='eTsgn'></ins><ul id='eTsgn'></ul><sub id='eTsgn'></sub></form><legend id='eTsgn'></legend><bdo id='eTsgn'><pre id='eTsgn'><center id='eTsgn'></center></pre></bdo></b><th id='eTsgn'></th></span></q></dt></tr></i><div id='eTsgn'><tfoot id='eTsgn'></tfoot><dl id='eTsgn'><fieldset id='eTsgn'></fieldset></dl></div>

                  2. <legend id='eTsgn'><style id='eTsgn'><dir id='eTsgn'><q id='eTsgn'></q></dir></style></legend>