TALKINCHAT SOURCE CODE

PART 2(SEND MESSAGE TO USER/JOIN ROOM/SEND MESSAGE IN ROOM IN TALKINCHAT)



Now after you done in my Part 1 Tutorials to Login,then Add  textbox ,name it txtusertarget

and add again textbox and name it txtmessage,and add 1 button name it btnsend.

Now double click the btnsned and add this codes.

'this codes for sending text....
ryu.sendmessage(txtusertarget.text,txtmessage.text,messagetype.chatmessage)

after you add that codes, build your projects and test the application,open your application,
login,after login succesfully,put the id of user you want to send message in txtusertarget,then add message in txtmessage and click btnsend.

now sending message to a user is working,go back to your project,

add textbox again,name it txtroomname = means this textbox is for roomname,add 1 button and name it btnjoin.

Now after you add textbox for room and button for join,double click the btnjoin and add this codes.

ryu.joinmuc(txtroomname.text)

now after you add that codes, run again your project,login,add name of your room in txtroomname and click btnjoin,YES! Now your id in your project is succesfully join in your room,
next the last part of this tutorials part 2 is for sending message in your room.


go back to your project,add textbox again and name it rommtextmessage and add 1 button name it btonroomsend,double click btnroomsend and add this codes.


ryu.sendmessage(txtroomname.text,roomtextmessage.text,messagetype.mucmessage


YES! Now Your talkinchat project is almost done!


Wait for the next tutorials..


Please stay tune on my blogsite and feel free to leave a comments,
please support on my channel .



PART 1(LOGIN IN TALKINCHAT)


Hi Friends, Now Im here to share a little codes and learn on how to make your own TalkinChat Software. First, You Need to download Visual Studio Older or Latest Version. DOWNLOAD FOR FREE  Visual Studio Click Me to Download
Now,after to download the Visual Studio and install,Open your visual studio and name your project. on this sample,name your project as "TalkinExample" after Name your Project, go to the option where you want to save your projects . after selecting where you save your projects,then click Ok. now, after clicking Ok,the form is show,you can see an empty Form, next, add 2 labels and name it username and password. next add 2 textbox and name it usernametextbox and passtextbox. next add 1 Button, Name it LoginBtn for the name and Sign In for the text now your form look like this.
now,the next step is fucos your mouse in your form and rightclick the mouse and select view code. After that, the page for codes is shown, now add this codes on the top of Public Class. 
 Imports TalkinClient.User
 Imports TalkinClient
 Imports MaterialSkin.Controls
 Imports System.Reflection
 Looks Like This
Now add the next codes after in the Public Class Form1

. Inherits MaterialForm
 Private ryu As TalkinChat 
 Private Delegate Sub SetControlPropertyThreadSafeDelegate(ByVal control As Control, ByVal propertyName As String, ByVal propertyValue As Object)




  Private Sub SetControlPropertyThreadSafe(ByVal control As Control, ByVal propertyName As String, ByVal propertyValue As Object)
        On Error Resume Next
        If control.InvokeRequired Then
            control.Invoke(New SetControlPropertyThreadSafeDelegate(AddressOf SetControlPropertyThreadSafe), New Object() {control, propertyName, propertyValue})
        Else
            control.[GetType]().InvokeMember(propertyName, BindingFlags.SetProperty, Nothing, control, New Object() {propertyValue})
        End If
    End Sub



    Private Sub loginMe()
        SetControlPropertyThreadSafe(statuslbl, "Text", "Connecting...")
        ryu = New TalkinChat()
        ryu.AutoReconnect = True
        ryu.ReconnectInterval = 10000
        AddHandler ryu.OnLogin, Function(ryu, authCode)
                                    Try
                                        Select Case authCode
                                            Case TalkinClient.User.AuthCode.Success
                                                statuslbl.Text = "Login Success."

                                                SetControlPropertyThreadSafe(Usernametextbox, "Enabled", False)
                                                SetControlPropertyThreadSafe(passtextbox, "Enabled", False)
                                                SetControlPropertyThreadSafe(loginBtn, "Text", "Logout")
                                                SetControlPropertyThreadSafe(loginBtn, "BackColor", Color.Red)
                                                SetControlPropertyThreadSafe(statuslbl, "Text", "Login Success.")
                                                SetControlPropertyThreadSafe(statuslbl, "ForeColor", Color.Green)

                                            Case TalkinClient.User.AuthCode.Failed
                                                Usernametextbox.Enabled = True
                                                passtextbox.Enabled = True
                                                loginBtn.Enabled = True
                                                statuslbl.Text = "Wrong Password."
                                                statuslbl.ForeColor = Color.Red
                                            Case TalkinClient.User.AuthCode.Disabled
                                                Usernametextbox.Enabled = True
                                                passtextbox.Enabled = True
                                                loginBtn.Enabled = True
                                                statuslbl.Text = "Account has been disabled."
                                                statuslbl.ForeColor = Color.Black
                                            Case TalkinClient.User.AuthCode.[Error]
                                                Usernametextbox.Enabled = True
                                                passtextbox.Enabled = True
                                                loginBtn.Enabled = True
                                                statuslbl.Text = "Unable to login."
                                                statuslbl.ForeColor = Color.Black
                                        End Select
                                    Catch
                                    End Try
#Disable Warning BC42105 ' Function doesn't return a value on all code paths
                                End Function
#Enable Warning BC42105 ' Function doesn't return a value on all code paths
        AddHandler ryu.OnLogout, Function(ryu)
                                     '  contactslistView.Items.Clear()
                                     SetControlPropertyThreadSafe(Usernametextbox, "Enabled", True)
                                     SetControlPropertyThreadSafe(passtextbox, "Enabled", True)
                                     SetControlPropertyThreadSafe(loginBtn, "Text", "Sign In")
                                     SetControlPropertyThreadSafe(loginBtn, "BackColor", Color.Green)
                                     SetControlPropertyThreadSafe(statuslbl, "Text", "Logged out.")
                                     SetControlPropertyThreadSafe(statuslbl, "ForeColor", Color.Black)
#Disable Warning BC42105 ' Function doesn't return a value on all code paths
                                 End Function
#Enable Warning BC42105 ' Function doesn't return a value on all code paths
        AddHandler ryu.OnClose, Function(ryu)
                                    SetControlPropertyThreadSafe(Usernametextbox, "Enabled", True)
                                    SetControlPropertyThreadSafe(passtextbox, "Enabled", True)
                                    SetControlPropertyThreadSafe(loginBtn, "Text", "Sign In")
                                    SetControlPropertyThreadSafe(loginBtn, "BackColor", Color.Green)
                                    '   contactslistView.Items.Clear()
                                    If ryu.AutoReconnect Then
                                        SetControlPropertyThreadSafe(statuslbl, "Text", "Reconnecting...")
                                    Else
                                        SetControlPropertyThreadSafe(statuslbl, "Text", "Disconnected.")
                                    End If
                                    SetControlPropertyThreadSafe(statuslbl, "ForeColor", Color.Black)
#Disable Warning BC42105 ' Function doesn't return a value on all code paths
                                End Function
#Enable Warning BC42105 ' Function doesn't return a value on all code paths
        AddHandler ryu.OnError, Function(ryu, [error])
                                    SetControlPropertyThreadSafe(Usernametextbox, "Enabled", True)
                                    SetControlPropertyThreadSafe(passtextbox, "Enabled", True)
                                    SetControlPropertyThreadSafe(loginBtn, "Text", "Sign In")
                                    SetControlPropertyThreadSafe(loginBtn, "BackColor", Color.Green)
                                    SetControlPropertyThreadSafe(statuslbl, "Text", "Error: " & [error])
                                    SetControlPropertyThreadSafe(statuslbl, "ForeColor", Color.Black)
#Disable Warning BC42105 ' Function doesn't return a value on all code paths
                                End Function
#Enable Warning BC42105 ' Function doesn't return a value on all code paths
        AddHandler ryu.OnChatMessage, AddressOf OnChatMessage
        If Not String.IsNullOrWhiteSpace(Usernametextbox.Text) AndAlso Not String.IsNullOrWhiteSpace(passtextbox.Text) Then
            ryu.Login(Usernametextbox.Text, passtextbox.Text)
        End If


 Looks Like this.
and the last Codes, go to your form and doubleclick the loginbutton and add this codes.

 loginMe()


 Looks Like this.
Now your Project is almost Ready to test,go to the top of visual studio and click build. after build succesfuly,then go to where your project save and open Debug Folder, select exe file and doubleclick to open, Now your first project is works, 

 Happy Coding,


If any Question bout this Guide,then 

you can leave comment here or message me on my talkinchat account syntax-error 

or mail me on d1mustdie@gmail.com








2 comments:

Anonymous said...

brother, from where we can download talkinchatClient dll?

_syntax-error_ said...

YOU CAN GET DLL FILE WHEN YOU DOWNLOAD 1 OF ANY MY TALKINCHAT SOFTWARE.
IF YOU WANT A FULL SOURCE CODE,THEN LET ME KNOW WHAT PROJECT YOU WANT TO BUILD AND I WILL ARRANGE THAT FOR YOU,ABOUT THE PRICE,DEPENDS ON WHAT PROJECT YOU WANT TO BUILD OR WHAT CODES YOU WANT.