0

I have progressed in downloading a text.txt page from a webpage and editing said text page, (win forms application), but cant find the information required to now upload the edited page back to the website, I used the code below to download the text, is there a similar function to upload the edited text file to the website, the website itself is ftp and have username and password access.

        System.Net.WebClient web = new System.Net.WebClient();
        System.IO.Stream stream = web.OpenRead("http://www.webite.xx.xx/text.txt");
        using (System.IO.StreamReader reader = new System.IO.StreamReader(stream))
        {
            String text = reader.ReadToEnd();
            textBox.Text = text;
  • That depends on the protocol used to upload content to your website. Multiple protocols are in use (FTP, WebDav, SSH, ...) and there is no standard. You need to ask the admin of your web page. – Heinzi Jan 18 '18 at 10:02
  • @ Heinzi Its FTP have passwords and usersnames etc – Johnliverpool Jan 18 '18 at 10:09
  • Good to know. I've marked your question as a duplicate of another one which should have the solution you need. If it doesn't, feel free to edit your question and explain why it doesn't. – Heinzi Jan 18 '18 at 10:14
  • @Heinzi I googled everything but via ftp was going to delete post but will mark as duplicate as my post is easier to find – Johnliverpool Jan 18 '18 at 10:17

0 Answers0