VB .NET FTP逐行写入文件

时间:2018-08-14 08:03:52

标签: .net vb.net file ftp

在VB.NET中是否可以将文件逐行直接写入FTP?

在应用程序中,我可以使用以下命令写文件:

<input v-model="message">

computed: {
  message: {
    get () {
      return this.$store.state.obj.message
    },
    set (value) {
      this.$store.commit('updateMessage', value)
    }
  }
}

您知道一个简短的示例,如何将文件直接写到FTP上吗?

1 个答案:

答案 0 :(得分:0)

绑定FtpWebRequestDim request As FtpWebRequest = WebRequest.Create("ftp://ftp.example.com/remote/path/file.txt") request.Credentials = New NetworkCredential("username", "password") request.Method = WebRequestMethods.Ftp.UploadFile Using stream As Stream = request.GetRequestStream(), writer As StreamWriter = New StreamWriter(stream) writer.WriteLine("line1") writer.WriteLine("line2") End Using 请求流:

window.history.pushState("", "", "/this-is-new-url?fakeparam=fakevalue");