How To Create a Chat App and Server Tutorial WPF C#

preview_player
Показать описание
Here is a tutorial showing you how to create a chat app and a chat server using WPF and C# which can also be used to create a game server in order to make a multiplayer game using C# WPF but the game can be made in Unity
this networking tutorial will show you how to create network packets, using TCP, which includes the TCPListener and TCPClient in order to make a chat app using C# programming and the WPF Framework, reading and writing binary data
using a network stream as well as a memorystream to create the network buffer, this tutorial includes events in order to make it slightly event driven. There is a video on my channel which features a modern professional chat app design

which you can follow and add to this project.

Рекомендации по теме
Комментарии
Автор

This man has a video on how to make a discord ui as well as how to create a chat app.... he essentially just gave the power of remaking discord to everyone

kay
Автор

As an experienced Java developer, I love these video tutorials that can take me into new languages quickly and efficiently.

YidingHe
Автор

The programming gods have blessed us brethren!

FiveNineO
Автор

amazing, modern c# networking content seems to be lacking, this is a nice breath of fresh air

energy-tunes
Автор

For everyone who doesn't wanna write out the code at 6:25 here you go:

namespace ChatClient.MVM.Core
{
class RelayCommand : ICommand
{
private Action<object> execute;
private Func<object, bool> canExecute;

public event EventHandler CanExecuteChanged
{
add { += value; }
remove { -= value; }
}

public RelayCommand(Action<object> execute, Func<object, bool> canExecute = null)
{
this.execute = execute;
this.canExecute = canExecute;
}

public bool CanExecute(object parameter)
{
return this.canExecute == null || this.canExecute(parameter);
}

public void Execute(object parameter)
{
this.execute(parameter);
}
}
}

DemHP.
Автор

This is one of the greatest tutorials ever, as a python developer that was the best tutorial on C#, sockets, and MVVC

ramzykaram
Автор

Great Vid, very instructional. One thing I would like to add, in the Packet Builder under the Write Message module, when using VS 17.4, you have to add 1 line to it, where you actually create a buffer and get a buffer length to get it to work properly. Well, at least for me this was the case, it may be a .Net version discrepancy also since 5.0 is no longer supported any more.

public void WriteMessage(string msg)
{
byte[] buff =
_ms.Write(buff, 0, buff.Length); This is where it breaks, because msg.Length was used here in the vid, but it needs to be the length of the buffer.
_ms.Write(Encoding.ASCII.GetBytes(msg), 0, msg.Length);
}

drewcumpton
Автор

I swear my computer listens to my conversations and recommends this video and I aint mad at all!

Worthical
Автор

Thank you so much. Your video helped a lot with my course project. I wouldn't have figured it out without you.

PavelS-mr
Автор

I absolutely love these videos. Please keep doing stuff like this, just watching you do stuff like this is helping me pick up better habits :D

Frusko
Автор

You saved my programming class test, thank you so much, cant wait to see more of your videos I also learned so many new things :)

Clay_CMC
Автор

Thanks for all your videos! I mainly code via scripting for work (data analysis). So it's a lot of just taking random data formats in, manipulating them, and outputting them in a format for some other program. I've always wanted to give a shot at developing my own desktop apps and your videos made everything just make sense, especially with how MVVM works in the real world. Even though I mostly only know Python/R I was able to quickly pick up C#/XAML and have been able to make a good looking and functional websocket app for a streamer friend to help automate their stream chats!

Baanchou
Автор

How to display multiple chat windows? My code is the same as in the video but it only displays 1 mainwindow window? Please help me answer. Please. Thanks

DangDucCoder
Автор

Please continue to make videos like witch you create small wpf apps with their cool design. I hope you make a wpf app with database like SQlite and made a customer like app where you add/modify/delete/filter into database.That will be very helpful for me and a lot of people as well.

barryjohnson
Автор

Hello, I have a problem at 19:25. MemoryStream.Write need 3 parameter (byte[] buffer, int offset, int count). But in the video you only pass one parameter. Is there a solution for this?

HighSkillxD
Автор

When iam copying the code from PacketBuilder like in 27:06 it shows an error and _ms.Write is red marked please help me i tried everything

enterprisemusicoffical
Автор

Hello, how did you create two instances of the MainWindow at around 38:25?

Hadouken
Автор

bro when clicked on Connect button => Server App Closed (crashed). also when i created project - i cant find .net 5 and last for me is 4.8.1 - can you think where is problem (my coding from 0 to 8 min of video)

Gamoten
Автор

how can we make the clients are able to send a private message, i.e. they are able to select one of the users in the chat room in some way and only the designated user will receive the message?

mohanadkiswany
Автор

1) It`s literally magnificent! Thank you so much, keep making such videos plz!
2) How did you set-up the color theme in your visual studio, look`s great!
3) Can this chat communicate over the Internet (computers are in different networks)?
Thanks for video, one more time!

AkarumeiAkashi
join shbcf.ru