C
C#12mo ago
Grin

✅ What knowledge base is necessary to create a winforms app that communicates with a server?

I'm trying to create a simple Winforms app to better understand how communications with servers work, but I've never worked with sql or online servers. I'd like to create a small winforms app with 8 checkboxes that communicate with an online server. I'd like for the server to have 8 boolean values that can be changed on my winforms app after the app fetches the boolean values from the server. What knowledge base do I need to do this besides c#? Where should I start to learn about setting up my own server for online use for the app?
4 Replies
arion
arion12mo ago
Its a bit of a loaded question but I can try. Winforms is an unpreferred UI framework as most choose the xaml based WPF framework instead. Winforms for the most part is drag and dropping elements with some code-behind on events such as clicking / checking your checkboxes. For example your checkbox method would be something like
private void OnCheckbox_Checked(object sender, SomeEventArgs args)
{
...
}
private void OnCheckbox_Checked(object sender, SomeEventArgs args)
{
...
}
The largest issue you might face as a beginner is the server-side. Some If/else questions for u: Do you plan to host the server yourself? Y: Plan to make it exposed to the internet? Y: Read up on port forwarding, static / dynamic ip addresses and / or VPS N: Read up on setting a static local IP in the router DHCP settings. N: Choose / read up on some cloud hosting solutions such as Amazon AWS, Microsoft Azure or Google Firebase In this case, for what type of server, maybe check out asp net core. Amazon has some pretty cool tools imo. It has lambdas and easy to use database options (all in free tier) Lambdas can also be set up for web-api which is nice Let me know if u have any other questions ^^
Grin
Grin12mo ago
I was planning on creating an online server that is accessed by a single winforms app and multiple android tablets (Xamarin). But just for the time being, to try to understand how this system would work I wanted to create a very very small winforms app that communicates with an online server I would host. I've never heard of port forwarding, static / dynamic ip addresses or VPS. I think my greatest weakness is understanding this stuff right now. I wish I could find a current book that just teaches users where to start to begin with servers and hosting.
arion
arion12mo ago
Usually your router would block people from the internet from just randomly connecting to your ip address and server port and checking whats there. Port forwarding tells your router that you intend to have people connect to that. A static IP is an ip address that doesn't change. A dynamic IP address is one that does change, be it after a few days or after you restart your router, meaning if someone wanted to connect to your server, your ip has now changed and they cant connect to the server anymore. A VPS is a virtual private server (Imagine it like running Linux in the terminal exclusively) it allows u to handle connections more easily (Though cloud solutions like amazon, microsoft and google are still the easiest and some are free (just dont spam)) My advice would be to pace yourself and focus on a managable project at a time. Eg. want to make a server? Test with postman(program) or a console app first. I'd highly recommend checking out AspNet Core videos, they're great
Grin
Grin12mo ago
I'll go ahead and look into AspNet Core videos. Thank you for all your advise and information.