TBMSamNew
New member
- Joined
- Apr 19, 2021
- Messages
- 3
- Programming Experience
- Beginner
Hello friends
I am trying to write a little application and, as I am only a student, i was wondering if someone maybe could help me with with some advices / tips to achieve the following:
On start, the desired program shall call a special function. That function looks onto a remote server (most likely it will be a NAS - network attached storage - with given username + password) if there is an update available. If yes, download & install it (including: display of the current progress for the user) and restart program afterwards.
Having done some research, I found the following code snippet, hope it helps:
Please note: there is a blank character between KlingGastro and Update.
Furthermore the credentials are "KlingGastro" as username, please excuse that I will not post password due to security reasons. Lets say its "myPassword".
I think downloading is not going to be that big problem, I already found this tutorial: How to download a webfile with C# and show download progress synchronously and asynchronously
Rather the cancellation of the program by itself and the restart might could be difficult?
Sorry for all potential language faults in addition, hope it was nevertheless somehow understandable.
Would be really happy for every answer and help effort.
Best regards
I am trying to write a little application and, as I am only a student, i was wondering if someone maybe could help me with with some advices / tips to achieve the following:
On start, the desired program shall call a special function. That function looks onto a remote server (most likely it will be a NAS - network attached storage - with given username + password) if there is an update available. If yes, download & install it (including: display of the current progress for the user) and restart program afterwards.
Having done some research, I found the following code snippet, hope it helps:
C#:
var webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync("https://195.50.139.130:5001/FTP/KlingGastro Update/file.txt", "C:\\file.txt");
Please note: there is a blank character between KlingGastro and Update.
Furthermore the credentials are "KlingGastro" as username, please excuse that I will not post password due to security reasons. Lets say its "myPassword".
I think downloading is not going to be that big problem, I already found this tutorial: How to download a webfile with C# and show download progress synchronously and asynchronously
Rather the cancellation of the program by itself and the restart might could be difficult?
Sorry for all potential language faults in addition, hope it was nevertheless somehow understandable.
Would be really happy for every answer and help effort.
Best regards