TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sam Mettenmeyer
NA
108
10.9k
Update a WinForms-Application automatically (async)
Apr 19 2021 8:33 AM
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 a display of the current progress) and restart program afterwards.
Having done some research, I found the following code snippet, hope it helps:
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:
https://ourcodeworld.com/articles/read/227/how-to-download-a-webfile-with-csharp-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
Reply
Answers (
1
)
Delete the record using button "Del" on the keyboard and WindowsForms
Convert Date into US date spell format.