Bonjours,
Je voudrais savoir si c'est faisable un système de tchat connecter a un server?
Merci d'avance! ^^
Bonjours,
Je voudrais savoir si c'est faisable un système de tchat connecter a un server?
Merci d'avance! ^^
Bonjour,
Effectivement vous pouvez faire un chat sous forme de site web, application Windows, application Windows Phone connecté à un serveur sous OS Windows, Linux, Mac, etc.
Etanne
"Phylactère temporaire" = tooltips
Votre problème a été résolu ? Alors utilisez sur et
Merci de ta réponse, j'ai trouver des logiciels toute faites, mais pas réellement opérationnel! :/
Je voudrais que des personnes puisse m'aider a programmer ce système!^^
Nous t'aiderons, mais pour cela faut coder un peu avant. On ne propose rien de tout fait, on aide sur les erreurs commises.
Tu as plein de tutos sur le site, de la documentation un peu partout, à toi d'avancer le plus loin possible.
ici c'est un forum d'AIDE et non d'édition de logiciels
Il n'y a pas besoin de chercher loin :
http://dotnet.developpez.com/telecha...r-un-mini-Chat
Inspire-toi en pour faire ton propre chat.
Keep calm and debug it
Countryball - Space Race, mon jeu mobile Google Store - Apple Store
Chaine YouTube sur Unity et le Gamedev en général
PlanQuiz - Mon jeu de Quiz multijoueur participatif
Merci pour votre réponse, je vais voir le lien que tu ma donnée PixelJuice!
J'ai commencer a en faire un en suivant un tuto, mais il utilise pas de server!
Voici le code:
Mais hélas, on est obliger d'utiliser l'ip de la personne, mais je voulais juste avoir une liste qu'on peut ajouter ces contacts et qui puisse discuter comme steam/skype/messanger/etc... .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 using System.Net; using System.Net.Sockets; using DevComponents.DotNetBar.Metro; namespace _2D_Gamers { public partial class Tchat : MetroForm { Socket sck; EndPoint epLocal, epRemote; byte[] buffer; public Tchat() { InitializeComponent(); } private void Tchat_Load(object sender, EventArgs e) { //Set up socket sck = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); sck.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); //Get user IP textIPAmis.Text = GetLocalIP(); textIPVous.Text = GetLocalIP(); } private string GetLocalIP() { IPHostEntry host; host = Dns.GetHostEntry(Dns.GetHostName()); foreach (IPAddress ip in host.AddressList) { if (ip.AddressFamily == AddressFamily.InterNetwork) return ip.ToString(); } return "127.0.0.1"; } private void connect_Click(object sender, EventArgs e) { //Binding Socket epLocal = new IPEndPoint(IPAddress.Parse(textIPAmis.Text), Convert.ToInt32(textPortAmis.Text)); sck.Bind(epLocal); //Connecting to remote IP epRemote = new IPEndPoint(IPAddress.Parse(textIPVous.Text), Convert.ToInt32(textPortVous.Text)); sck.Connect(epRemote); //Listening the specific port buffer = new byte[1500]; sck.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref epRemote, new AsyncCallback(MessageCallBack), buffer); } private void MessageCallBack(IAsyncResult aResult) { try { byte[] receivedData = new byte[1500]; receivedData = (byte[])aResult.AsyncState; //Converting byte[] to string ASCIIEncoding aEncoding = new ASCIIEncoding(); string receivedMessage = aEncoding.GetString(receivedData); //Adding this message into listbox listMessageBox.Items.Add("Friend: " + receivedMessage); buffer = new byte[1500]; sck.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref epRemote, new AsyncCallback(MessageCallBack), buffer); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } private void envMessage_Click(object sender, EventArgs e) { //Convert string message to in byte[] ASCIIEncoding aEncoding = new ASCIIEncoding(); byte[] sendingMessage = new byte[1500]; sendingMessage = aEncoding.GetBytes(textMessage.Text); //Sending the Encoded message sck.Send(sendingMessage); //Adding to the listBox listMessageBox.Items.Add("Me: " + textMessage.Text); textMessage.Text = ""; } } }
EDIT: Je peux pas ouvrir les dossiers!
J'ai que Visual Studio for Windows Desktop et Visual Studio for Web!
C'est juste savoir comment ne pas utiliser l'ip de la personne, je voudrais faire comme Messenger!
Bonsoir,
Pour faire comme MSN, Skype, etc.. ..il faudra alors faire un serveur
Etanne
"Phylactère temporaire" = tooltips
Votre problème a été résolu ? Alors utilisez sur et
J'ai suivie un tuto: http://web.microapp.com/contenus_pro...26/extrait.pdf
J'ai fait ceci en VB.NET:
FORM1:
Code vb.net : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200 Imports XihSolutions.DotMSN.Messenger Imports XihSolutions.DotMSN Public Class Form1 Private Delegate Sub UpdateControlTextDelegate(ByVal text As String) Private Delegate Sub UpdateControlDelegate() Private Delegate Sub CreateConversationTabDelegate(ByVal conversation As Conversation) Friend Messenger As Messenger Public Sub New() ' Cet appel est requis par le Concepteur InitializeComponent() Messenger = New Messenger() ' Imiter MSN Messenger Messenger.Credentials.ClientID = "msmsgs@msnmsgr.com" Messenger.Credentials.ClientCode = "Q1P7W2E4J9R8U3S5" AddHandler _ Messenger.NameserverProcessor.ConnectionEstablished, _ AddressOf NameserverProcessor_ConnectionEstablished AddHandler Messenger.Nameserver.SignedIn, _ AddressOf Nameserver_SignedIn AddHandler Messenger.Nameserver.SignedOff, _ AddressOf Nameserver_SignedOff AddHandler Messenger.Nameserver.AuthenticationError, _ AddressOf Nameserver_AuthenticationError AddHandler Messenger.ConversationCreated, _ AddressOf Messenger_ConversationCreated End Sub Private Sub NameserverProcessor_ConnectionEstablished( _ ByVal sender As Object, ByVal e As EventArgs) Update_Status("Connecté au serveur") End Sub Private Sub Update_Status(ByVal status As String) Invoke(New UpdateControlTextDelegate( _ AddressOf Update_Status_Synchro), New Object() {status}) End Sub Private Sub Update_Status_Synchro(ByVal status As String) Me.Status.Text = status End Sub Private Sub Nameserver_SignedIn(ByVal sender As Object, _ ByVal e As EventArgs) Messenger.Owner.Status = PresenceStatus.Online Update_Contacts() Update_Status(Messenger.Owner.Name & " connecté") Update_Bouton("Déco") End Sub Private Sub Nameserver_SignedOff(ByVal sender As Object, _ ByVal e As SignedOffEventArgs) Messenger.Disconnect() CloseAllTabs() Update_Contacts() Update_Status("Déconnecté") Update_Bouton("OK") End Sub Private Sub Update_Bouton(ByVal text As String) Invoke(New UpdateControlTextDelegate( _ AddressOf Update_Bouton_Synchro), New Object() {text}) End Sub Private Sub Update_Bouton_Synchro(ByVal text As String) Connexion.Text = text End Sub Private Sub Update_Contacts() Invoke(New UpdateControlDelegate( _ AddressOf Update_Contacts_Synchro)) End Sub Private Sub Update_Contacts_Synchro() Contacts.SuspendLayout() Contacts.Items.Clear() If Messenger.Connected Then For Each Contact As Contact In Messenger.ContactList.All Dim item As New ListViewItem item.Text = Contact.Name item.Tag = Contact Contacts.Items.Add(item) Next End If Contacts.ResumeLayout() End Sub Private Sub CloseAllTabs() Invoke(New UpdateControlDelegate( _ AddressOf CloseAllTabs_Synchro)) End Sub Private Sub CloseAllTabs_Synchro() For Each tab As TabPage In Conversations.TabPages Conversations.TabPages.Remove(tab) Next End Sub Private Sub Nameserver_AuthenticationError( _ ByVal sender As Object, ByVal e As ExceptionEventArgs) MessageBox.Show( _ "Vérifiez votre adresse e-mail et votre mot de passe.", _ "Erreur dauthentification") Messenger.Disconnect() End Sub Private Sub Messenger_ConversationCreated( _ ByVal sender As Object, _ ByVal e As ConversationCreatedEventArgs) If e.Initiator Is Nothing Then Invoke(New CreateConversationTabDelegate( _ AddressOf CreateConversationTab), _ New Object() {e.Conversation}) End If End Sub Private Sub CreateConversationTab( _ ByVal conversation As Conversation) Dim newTabPage As New TabPage Dim newDialogue As New Dialogue(conversation) If conversation.SwitchboardProcessor Is Nothing OrElse _ Not conversation.SwitchboardProcessor.Connected Then conversation.Messenger.Nameserver.RequestSwitchboard( _ conversation.Switchboard, conversation.Messenger) Threading.Thread.Sleep(1000) End If Dim contacts As New System.Text.StringBuilder For Each contact As DictionaryEntry In _ conversation.Switchboard.Contacts contacts.AppendFormat("{0}, ", _ CType(contact.Value, Contact).Name) Next If (contacts.Length > 2) Then contacts.Remove(contacts.Length - 2, 2) End If newTabPage.Text = contacts.ToString newDialogue.Dock = DockStyle.Fill newTabPage.Controls.Add(newDialogue) Conversations.TabPages.Add(newTabPage) Conversations.SelectTab(newTabPage) End Sub Private Sub Connexion_Click(sender As Object, ByVal e As System.EventArgs) Handles Connexion.Click If Not Messenger.Connected Then If Adresse.Text.Length > 0 Then Messenger.Credentials.Account = Adresse.Text Messenger.Credentials.Password = MotDePasse.Text Messenger.Connect() Update_Status("Connexion ") End If Else Messenger.Disconnect() End If End Sub Private Sub Contacts_DoubleClick(sender As Object, ByVal e As System.EventArgs) Handles Contacts.DoubleClick If Contacts.SelectedItems.Count = 1 Then Dim contactSelectionne As Contact = _ CType(Contacts.SelectedItems(0).Tag, Contact) If contactSelectionne IsNot Nothing AndAlso _ contactSelectionne.Online Then Dim conversation As Conversation = _ Messenger.CreateConversation() conversation.Invite(contactSelectionne) CreateConversationTab(conversation) End If End If End Sub Private Sub Envoyer_Click(sender As Object, ByVal e As System.EventArgs) Handles Envoyer.Click If Conversations.SelectedTab IsNot Nothing And _ MonTexte.Text.Length > 0 Then Dim dialogue As Dialogue = _ Conversations.SelectedTab.Controls(0) Dim conversation As Conversation = _ dialogue.Conversation If Not conversation.SwitchboardProcessor.Connected Then conversation.Messenger.Nameserver.RequestSwitchboard( _ conversation.Switchboard, Messenger) End If Dim message As New TextMessage(MonTexte.Text) conversation.Switchboard.SendTextMessage(message) MonTexte.Clear() dialogue.AppendText("Moi:" & message.Text & vbCrLf) End If End Sub Private Sub MonTexte_KeyDown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles MonTexte.KeyDown If e.KeyCode = Keys.Enter Then Envoyer.PerformClick() e.SuppressKeyPress = True End If End Sub Private Sub Conversations_DoubleClick(sender As Object, e As EventArgs) Handles Conversations.DoubleClick Conversations.TabPages.Remove(Conversations.SelectedTab) End Sub End Class
Class Dialogue:
Code vb.net : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 Imports XihSolutions.DotMSN Public Class Dialogue Private Delegate Sub UpdateConversationText( _ ByVal text As String) Private m_conversation As Conversation Public Sub New(ByVal conversation As Conversation) ' Cet appel est requis par le Concepteur InitializeComponent() m_conversation = conversation AddHandler _ conversation.Switchboard.TextMessageReceived, _ AddressOf Switchboard_TextMessageReceived End Sub Public ReadOnly Property Conversation() As Conversation Get Return m_conversation End Get End Property Public Sub AppendText(ByVal text As String) Invoke(New UpdateConversationText( _ AddressOf AppendText_Synch), New Object() {text}) End Sub Private Sub AppendText_Synch(ByVal text As String) TextBox1.AppendText(text) End Sub Private Sub Switchboard_TextMessageReceived( _ ByVal sender As Object, ByVal e As TextMessageEventArgs) AppendText(String.Format("{0} : {1}{2}", _ e.Sender.Name, e.Message.Text, vbCrLf)) End Sub End Class
Mais le problème, c'est que je vois pas mes contact et cette ligne là:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Messenger.Credentials.ClientID = "msmsgs@msnmsgr.com" Messenger.Credentials.ClientCode = "Q1P7W2E4J9R8U3S5"Je sais pas quoi mettre --'On crée aussi un constructeur pour le formulaire afin d’initialiser l’objet
Messenger. Il faut configurer les paramètres avec lesquels le client va se
présenter auprès du service de messagerie. Ces paramètres permettent d’identifier l’application, et non pas l’utilisateur qui veut se connecter au service.
Dans cet exemple, on personnifie le client MSN Messenger de Microsoft.
Si vous souhaitez déployer une application qui se connecte au service de
messagerie MSN, vous devrez vous procurer vos propres identifiants auprès deMSN.
Merci d'avance!
A en lire le résumé les informations sont fournis par MSN lors de l'inscription d'une application.
Je pense que cela pourra vous aider : Registering Your Application with Windows Live
Mais quelque chose me perturbe, MSN a fermé ses services en Mai 2013.. ..il fort probable que le logiciel ne fonctionnera pas !
"Phylactère temporaire" = tooltips
Votre problème a été résolu ? Alors utilisez sur et
Bha sa fonctionne pas! :/
bon je laisse tomber, l'utilisateur doit mettre ip de la personne qui veut discuter!
Je vais faire comme ça!
Bon, j'ai réussi a faire un serveur, mais j'ai un problème:
Sa va vient de la 2eme ligne:Une exception non gérée du type 'System.Data.SqlClient.SqlException' s'est produite dans System.Data.dll
Informations supplémentaires*: Une erreur liée au réseau ou spécifique à l'instance s'est produite lors de l'établissement d'une connexion à SQL Server. Le serveur est introuvable ou n'est pas accessible. Vérifiez que le nom de l'instance est correct et que SQL Server est configuré pour autoriser les connexions distantes. (provider: Named Pipes Provider, error: 40 - Impossible d'ouvrir une connexion à SQL Server)
Donc je sais pas comment le corriger! :'(
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 SqlConnection conn = new SqlConnection("server=localhost ;Database=steammaker ;Integrated Security = true"); conn.Open();
Merci d'avance!
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager