在VB.NET中是否可以将文件逐行直接写入FTP?
在应用程序中,我可以使用以下命令写文件:
<input v-model="message">
computed: {
message: {
get () {
return this.$store.state.obj.message
},
set (value) {
this.$store.commit('updateMessage', value)
}
}
}
您知道一个简短的示例,如何将文件直接写到FTP上吗?
答案 0 :(得分:0)
绑定FtpWebRequest
至Dim 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");