Connexion
S'inscrire
Actualités
Quoi de neuf
Activités générales
Auteurs
Forums
Nouveaux messages
Rechercher un forum
Wiki
Pages
Dernière activité
Quoi de neuf
Nouveaux messages
Nouveaux messages de profil
Activités générales
Membres
Membres inscrits
Visiteurs actuels
Nouveaux messages de profil
Rechercher dans les messages des profils
Teams
Créé ton équipe
Quoi de neuf ?
Nouveaux messages
Rechercher un forum
Menu
Connexion
S'inscrire
Install the app
Install
Forums
Forums généraux
RealityGaming
CRÉER SON PROPRE CHAT [VB.NET]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Vous utilisez un navigateur non à jour ou ancien. Il ne peut pas afficher ce site ou d'autres sites correctement.
Vous devez le mettre à jour ou utiliser un
navigateur alternatif
.
Répondre à la discussion
Message
<blockquote data-quote="Paradise'" data-source="post: 3967251" data-attributes="member: 300598"><p style="text-align: center"><strong><img src="http://www.hostingpics.net/thumbs/94/51/24/mini_945124Iconice06d0256.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></strong></p> <p style="text-align: center"><strong><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">CRÉER SON PROPRE CHAT [VB.NET]</span></span></strong></p><p></p><p></p><p>[tabs]</p><p>[tab=Informations concernant ce tutoriel]• <span style="color: #2C3E50"><strong>Temps</strong></span> de lecture :<span style="color: #2C3E50"><strong> 10 </strong></span>minutes.</p><p>• <span style="color: #2c3e50"><strong>Temps</strong> </span>de rédaction :<strong> <span style="color: #2c3e50">02</span> </strong>heures.</p><p>• <strong><span style="color: #2C3E50">Difficulté</span></strong> : <span style="color: #F1C40F">★★★</span></p><p>• <strong><span style="color: #2c3e50">Matériel</span></strong><span style="color: #000000"> requis : Ordinateur sous Windows XP/Vista/7/8/8.1, </span><span style="color: #2c3e50"><strong>Visual Studio</strong></span><span style="color: #000000">, </span><strong><span style="color: #2c3e50">ressources en question, un site web avec un FTP.</span></strong></p><p>• <strong><span style="color: #2C3E50">Tutoriel</span></strong> proposé par la <strong><a href="http://reality-gaming.fr/teams/good-topic-premium.43/" target="_blank"><span style="color: #2c3e50">GTP</span></a></strong>, écris par <span style="color: #2c3e50"><strong>Boosterz GTP.</strong></span></p><p>[/tab]</p><p>[tab=Ressources nécessaire]• iChat.dll : <a href="https://mega.co.nz/#!wQhQ2bhS!rTaEKf5Vi6_erKzp2bsCfb9ixhi7eXa6FFfZtaNMVro" target="_blank">MEGA</a> | <a href="http://www.mediafire.com/download/k3c4jufh6jp89bn/iChat.zip" target="_blank">MEDIAFIRE</a> | <a href="https://www.virustotal.com/fr/file/e2497655d82318a9c9a33093d2aeb571a634ac7b30032d30eb831595fd8ca95d/analysis/1408957024/" target="_blank">Virus Scan</a></p><p>• FTP Files : <a href="https://mega.co.nz/#!4c4lHRKC!AnnuqQDBVRGay7hYjxOCU9J2tKnYhe7UywXYcj2rWQY" target="_blank">MEGA</a> | <a href="http://www.mediafire.com/download/qvc7pc2bvikdzlt/FTP_Files.zip" target="_blank">MEDIAFIRE</a> | <a href="https://www.virustotal.com/fr/file/44ad02af8c12eb204dd7cb9d54fcef740a030e3eb0d41507e041d6e4f40327a1/analysis/1408957245/" target="_blank">Virus Scan</a></p><p>[/tab]</p><p>[tab=Autres téléchargements]• GTPChat ( Chat déjà codé ) : <a href="https://mega.co.nz/#!JURTWKiZ!1b9-OKM6e0r3nzeHqME256kjlyUvnjoR5clUZLYaCEo" target="_blank">MEGA</a> | <a href="http://www.mediafire.com/download/f9r0n7lwcwszi1o/GTPChat.zip" target="_blank">MEDIAFIRE</a> | <a href="https://www.virustotal.com/fr/file/7494f6e579814804d4569a0a2711190f5a6db8d10ae6fca092a38916f730b5b9/analysis/1408957405/" target="_blank">Virus Scan</a></p><p>• Code Source : <a href="https://mega.co.nz/#!FZYAWLZL" target="_blank">MEGA</a> | <a href="https://www.virustotal.com/fr/file/63963618ac237a404c572c36d546cccbadcde90efb8c2b175731d9e531e74616/analysis/1408961796/" target="_blank">Virus Scan</a></p><p>Pour le code source seul MEGA est disponible, car afin d'éviter juste le téléchargement de la source la key de téléchargement MEGA sera disponible quelque part dans le tutoriel.</p><p>[/tab]</p><p>[/tabs]</p><p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/35/1408958240-entypo-d83d-0-128.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">Partie 1 : FTP</span></span></p><p></p><p><strong><span style="color: #2c3e50">D</span></strong>onc pour cette partie il vous faudra donc l'accès à votre FTP ainsi que le dossier FTP Files.</p><p>Vous n'avez presque rien à faire, cool non ?</p><p>La seul vrai chose à faire c'est ouvrir le fichier : "Admin.txt" et la vous mettez à la place de Administrateur le nom de l'administrateur du chat, il pourra vider le chat etc.</p><p>Ensuite vous prenez les 16 fichiers que vous mettez à la racine de votre FTP.</p><p>Cette partie est finit, dur ? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite171" alt=":D" title="Awesome face :D" loading="lazy" data-shortname=":D" /></p><p></p><p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/35/1408958529-entypo-e74e-0-128.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">Partie 2 : Codage du logiciel.</span></span></p><p></p><p><strong><span style="color: #2c3e50">D</span></strong>onc si vous avez télécharger ce que j'ai dis, vous pouvez voir que il y a une assembly , je vous ai donc prémâcher le boulot, donc commencer par l'importer.</p><p>Ensuite on déclare son utilisation :</p><p>[CODE]</p><p>Imports iChat</p><p>[/CODE]</p><p>Puis on définit " API " comme " iChatAPI ".</p><p>[CODE]</p><p> Dim API As New iChatAPI</p><p>[/CODE]</p><p><img src="http://i.gyazo.com/5db27ae0e83e64127b1d9f471fc0163f.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Donc une fois ceci on passe au design de la Form1 la connexion au serveur de chat voulu.</p><p><img src="http://i.gyazo.com/fb2d77dbe490464140100407f25c2566.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Voila donc très simple comme design après vous pouvez le travailler par exemple voici le mien dans le GTPChat :</p><p><img src="http://i.gyazo.com/7d8588bef9d5c83f24637d14307b95da.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Cela donne déjà plus envie mais je ne suis pas ici pour vous apprendre à faire un jolie design.</p><p>Donc dans le code du bouton vous mettez ceci :</p><p>[CODE]</p><p> API.strUsername = PseudoTXT.Text</p><p> API.strChatSite = ServeurTXT.Text</p><p> If API.IsIPBanned(API.GetIP()) = False And API.IsBanned(API.strUsername) = False Then</p><p> If API.NameAvailable(API.strUsername) = True Then</p><p> If API.AddUser(API.strUsername) = True Then</p><p> My.Settings.strName = PseudoTXT.Text</p><p> My.Settings.strChatSite = ServeurTXT.Text</p><p> My.Settings.Save()</p><p> Form2.Show()</p><p> Me.Hide()</p><p> Else</p><p> MessageBox.Show("Erreur, non connecté", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Information)</p><p> End If</p><p> Else</p><p> MessageBox.Show("Nom d'utilisateur incorect.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Information)</p><p> End If</p><p> Else</p><p> MessageBox.Show("Votre compte a était bannis.", "Banned", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)</p><p> End If</p><p>[/CODE]</p><p></p><p>Normalement à ce moment la vous avez <strong>3 erreurs</strong>.</p><p>Donc on va ajouter les " Settings " dans l'application ce qui servira à sauvegarder automatiquement le pseudo et le serveur de chat.</p><p>Voici comment faire ( Dans l'image je n'es pas eu le temps de faire les deux )</p><p><img src="http://i.gyazo.com/6e7d3e0047c5dc326f26c8f6a7ed0d06.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Voila une fois que vous avez ajouter les deux vous ne devez plus avoir que une seul erreur.</p><p><img src="http://i.gyazo.com/46d717332eabfd508f2f31b13b203502.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Ne vous en faites pas elle partira seul après.</p><p>Ensuite à l'ouverture de la Form on veut bien ne pas avoir à retaper notre pseudo et le serveur de chat ?</p><p>Alors il faut mettre ce code à l'ouverture de la form ( double clique dessus )</p><p>[CODE]</p><p> If My.Settings.strName <> "" Then</p><p> PseudoTXT.Text = My.Settings.strName</p><p> End If</p><p> If My.Settings.strChatSite <> "" Then</p><p> ServeurTXT.Text = My.Settings.strChatSite</p><p> End If</p><p>[/CODE]</p><p><img src="http://i.gyazo.com/6f75dd2d2a27499db7da7a342ef25cb7.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Voila donc pour la Form de connexion c'est finit ! On passe donc à la Form de chat qui s'appelle donc : Form2. Voila une image qui montre comment ajouter une form :</p><p><img src="http://i.gyazo.com/47594e3358619fc74d491862e2f96a49.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>Ensuite voila il n'y a plus d'erreur <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite355" alt=":)" title=":) :)" loading="lazy" data-shortname=":)" /></p><p>Donc il faut re déclarer l'utilisation de l'assembly et la fonction API. Je ne redirais pas comment faire.</p><p>Voila le design à faire :</p><p><img src="http://i.gyazo.com/2864296aed0d98c40fb01a3f19132b19.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Donc pour ajouter la ScrollBars sur la textbox du chat voila comment faire</p><p><img src="http://i.gyazo.com/059bf0c048bab707fe5202b60ada333d.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Puis on ajoute 2 timers :</p><ol> <li data-xf-list-type="ol">" Timer1 "</li> <li data-xf-list-type="ol">" tmrBan "</li> </ol><p>Donc on va commencé simplement par le code du bouton :</p><p>[CODE]</p><p> If API.SendMessage(API.strUsername, txtMessage.Text) = True Then</p><p> API.UpdateChat(txtChat)</p><p> txtMessage.Text = ""</p><p> Else</p><p> MessageBox.Show("Message non envoyé.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information)</p><p> End If</p><p>[/CODE]</p><p>Puis comme tout à l'heure on met le code à l'ouverture de la Form.</p><p>[CODE]</p><p> API.strUsername = Form1.PseudoTXT.Text</p><p> API.strChatSite = Form1.ServeurTXT.Text</p><p> API.strIP = API.GetIP</p><p> API.UpdateChat(txtChat)</p><p> txtChat.SelectionStart = txtChat.TextLength</p><p> txtChat.ScrollToCaret()</p><p> Timer1.Start()</p><p>[/CODE]</p><p><span style="font-size: 9px">Key de la source :</span></p><p><span style="font-size: 9px">Wv64VEvvjsNI5SqyQH2kqGii_HNk9gZRQqfKkhgPSCs</span></p><p><span style="font-size: 9px"></span></p><p>Ensuite ce code à la fermeture [ TRÈS IMPORTANT ] Si vous ne le mettez pas le chat croira que l'utilisateur est encore en ligne donc impossible de ce re connecter avec le même pseudo mit à part en vidant le FTP et re upload.</p><p>[CODE]</p><p> API.DeleteUser(API.strUsername)</p><p> Form1.Show()</p><p>[/CODE]</p><p><img src="http://i.gyazo.com/f30dd25c84de693a515051fa18fa76e7.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>Voila ensuite votre compte sera fermer vous pourrez utilisé le même pseudo la prochaine fois.</p><p>Donc ensuite le code dans le KeyUp de la textbox message ( voila comment faire )</p><p><img src="http://i.gyazo.com/f275a721719334beb3e1c7a1b5ad2eba.gif" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>[CODE]</p><p> If e.KeyCode = Keys.Enter Then</p><p> If API.SendMessage(API.strUsername, txtMessage.Text) = True Then</p><p> API.UpdateChat(txtChat)</p><p> txtMessage.Text = ""</p><p> Else</p><p> MessageBox.Show("Message non envoyé.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Information)</p><p> End If</p><p> End If</p><p>[/CODE]</p><p>Donc ensuite pour refresh le texte du chat on met ceci dans le timer1 :</p><p>[CODE]</p><p> API.UpdateChat(txtChat)</p><p>[/CODE]</p><p>Ensuite dans le timer ban vous mettez sa :</p><p>[CODE]</p><p> If API.IsBanned(API.strUsername) = True Then</p><p> Me.Close()</p><p> Form1.Show()</p><p> MessageBox.Show("Compte bannis", "Banned", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)</p><p> End If</p><p> If API.IPisRequested = True And API.GetRequestedIP <> API.strIP Then</p><p> If API.WriteIP(API.strIP) = True Then</p><p> End If</p><p> End If</p><p>[/CODE]</p><p>Ensuite dans le changement de texte de la textbox du chat ( double clique dessus ) vous mettez :</p><p>[CODE]</p><p> txtChat.SelectionStart = txtChat.TextLength</p><p> txtChat.ScrollToCaret()</p><p>[/CODE]</p><p></p><p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"></p> <p style="text-align: center"><img src="http://image.noelshack.com/fichiers/2014/32/1407687234-finish.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p> <p style="text-align: center"><span style="font-family: 'Open sans condensed'"><span style="color: #2C3E50">FIN DU TUTORIEL</span></span></p><p></p><p><strong><span style="color: #2c3e50">Merci à tous</span></strong><span style="color: #000000"> d'avoir lu ce tutoriel, je vous dis à très bientôt pour de </span><strong><span style="color: #2c3e50">prochains tutoriels</span></strong><span style="color: #000000"> ! <img src="/data/assets/smilies/tchuss.gif" class="smilie" loading="lazy" alt=":tchuss:" title="Tchuss :tchuss:" data-shortname=":tchuss:" /></span></p><p></p><p style="text-align: right"><span style="color: #000000">Sujet rédigé </span><u><strong><span style="color: #2c3e50">entièrement</span></strong></u><span style="color: #000000"> par </span><strong><span style="color: #2C3E50">Boosterz GTP</span></strong></p><p></p><p></p><p style="text-align: center"><span style="color: #000000"><a href="http://reality-gaming.fr/teams/good-topic-premium.43/" target="_blank"><img src="http://image.noelshack.com/fichiers/2014/32/1407687168-gtpend.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></a> </span></p></blockquote><p></p>
[QUOTE="Paradise', post: 3967251, member: 300598"] [CENTER][B][IMG]http://www.hostingpics.net/thumbs/94/51/24/mini_945124Iconice06d0256.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50]CRÉER SON PROPRE CHAT [VB.NET][/COLOR][/FONT][/B][/CENTER] [tabs] [tab=Informations concernant ce tutoriel]• [COLOR=#2C3E50][B]Temps[/B][/COLOR] de lecture :[COLOR=#2C3E50][B] 10 [/B][/COLOR]minutes. • [COLOR=#2c3e50][B]Temps[/B] [/COLOR]de rédaction :[B] [COLOR=#2c3e50]02[/COLOR] [/B]heures. • [B][COLOR=#2C3E50]Difficulté[/COLOR][/B] : [COLOR=#F1C40F]★★★[/COLOR] • [B][COLOR=#2c3e50]Matériel[/COLOR][/B][COLOR=#000000] requis : Ordinateur sous Windows XP/Vista/7/8/8.1, [/COLOR][COLOR=#2c3e50][B]Visual Studio[/B][/COLOR][COLOR=#000000], [/COLOR][B][COLOR=#2c3e50]ressources en question, un site web avec un FTP.[/COLOR][/B] • [B][COLOR=#2C3E50]Tutoriel[/COLOR][/B] proposé par la [B][URL='http://reality-gaming.fr/teams/good-topic-premium.43/'][COLOR=#2c3e50]GTP[/COLOR][/URL][/B], écris par [COLOR=#2c3e50][B]Boosterz GTP.[/B][/COLOR] [/tab] [tab=Ressources nécessaire]• iChat.dll : [URL='https://mega.co.nz/#!wQhQ2bhS!rTaEKf5Vi6_erKzp2bsCfb9ixhi7eXa6FFfZtaNMVro']MEGA[/URL] | [URL='http://www.mediafire.com/download/k3c4jufh6jp89bn/iChat.zip']MEDIAFIRE[/URL] | [URL='https://www.virustotal.com/fr/file/e2497655d82318a9c9a33093d2aeb571a634ac7b30032d30eb831595fd8ca95d/analysis/1408957024/']Virus Scan[/URL] • FTP Files : [URL='https://mega.co.nz/#!4c4lHRKC!AnnuqQDBVRGay7hYjxOCU9J2tKnYhe7UywXYcj2rWQY']MEGA[/URL] | [URL='http://www.mediafire.com/download/qvc7pc2bvikdzlt/FTP_Files.zip']MEDIAFIRE[/URL] | [URL='https://www.virustotal.com/fr/file/44ad02af8c12eb204dd7cb9d54fcef740a030e3eb0d41507e041d6e4f40327a1/analysis/1408957245/']Virus Scan[/URL] [/tab] [tab=Autres téléchargements]• GTPChat ( Chat déjà codé ) : [URL='https://mega.co.nz/#!JURTWKiZ!1b9-OKM6e0r3nzeHqME256kjlyUvnjoR5clUZLYaCEo']MEGA[/URL] | [URL='http://www.mediafire.com/download/f9r0n7lwcwszi1o/GTPChat.zip']MEDIAFIRE[/URL] | [URL='https://www.virustotal.com/fr/file/7494f6e579814804d4569a0a2711190f5a6db8d10ae6fca092a38916f730b5b9/analysis/1408957405/']Virus Scan[/URL] • Code Source : [URL='https://mega.co.nz/#!FZYAWLZL']MEGA[/URL] | [URL='https://www.virustotal.com/fr/file/63963618ac237a404c572c36d546cccbadcde90efb8c2b175731d9e531e74616/analysis/1408961796/']Virus Scan[/URL] Pour le code source seul MEGA est disponible, car afin d'éviter juste le téléchargement de la source la key de téléchargement MEGA sera disponible quelque part dans le tutoriel. [/tab] [/tabs] [CENTER][IMG]http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png[/IMG] [IMG]http://image.noelshack.com/fichiers/2014/35/1408958240-entypo-d83d-0-128.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50]Partie 1 : FTP[/COLOR][/FONT][/CENTER] [B][COLOR=#2c3e50]D[/COLOR][/B]onc pour cette partie il vous faudra donc l'accès à votre FTP ainsi que le dossier FTP Files. Vous n'avez presque rien à faire, cool non ? La seul vrai chose à faire c'est ouvrir le fichier : "Admin.txt" et la vous mettez à la place de Administrateur le nom de l'administrateur du chat, il pourra vider le chat etc. Ensuite vous prenez les 16 fichiers que vous mettez à la racine de votre FTP. Cette partie est finit, dur ? :D [CENTER][IMG]http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png[/IMG] [IMG]http://image.noelshack.com/fichiers/2014/35/1408958529-entypo-e74e-0-128.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50]Partie 2 : Codage du logiciel.[/COLOR][/FONT][/CENTER] [B][COLOR=#2c3e50]D[/COLOR][/B]onc si vous avez télécharger ce que j'ai dis, vous pouvez voir que il y a une assembly , je vous ai donc prémâcher le boulot, donc commencer par l'importer. Ensuite on déclare son utilisation : [CODE] Imports iChat [/CODE] Puis on définit " API " comme " iChatAPI ". [CODE] Dim API As New iChatAPI [/CODE] [IMG]http://i.gyazo.com/5db27ae0e83e64127b1d9f471fc0163f.png[/IMG] Donc une fois ceci on passe au design de la Form1 la connexion au serveur de chat voulu. [IMG]http://i.gyazo.com/fb2d77dbe490464140100407f25c2566.png[/IMG] Voila donc très simple comme design après vous pouvez le travailler par exemple voici le mien dans le GTPChat : [IMG]http://i.gyazo.com/7d8588bef9d5c83f24637d14307b95da.png[/IMG] Cela donne déjà plus envie mais je ne suis pas ici pour vous apprendre à faire un jolie design. Donc dans le code du bouton vous mettez ceci : [CODE] API.strUsername = PseudoTXT.Text API.strChatSite = ServeurTXT.Text If API.IsIPBanned(API.GetIP()) = False And API.IsBanned(API.strUsername) = False Then If API.NameAvailable(API.strUsername) = True Then If API.AddUser(API.strUsername) = True Then My.Settings.strName = PseudoTXT.Text My.Settings.strChatSite = ServeurTXT.Text My.Settings.Save() Form2.Show() Me.Hide() Else MessageBox.Show("Erreur, non connecté", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Information) End If Else MessageBox.Show("Nom d'utilisateur incorect.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Information) End If Else MessageBox.Show("Votre compte a était bannis.", "Banned", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End If [/CODE] Normalement à ce moment la vous avez [B]3 erreurs[/B]. Donc on va ajouter les " Settings " dans l'application ce qui servira à sauvegarder automatiquement le pseudo et le serveur de chat. Voici comment faire ( Dans l'image je n'es pas eu le temps de faire les deux ) [IMG]http://i.gyazo.com/6e7d3e0047c5dc326f26c8f6a7ed0d06.gif[/IMG] Voila une fois que vous avez ajouter les deux vous ne devez plus avoir que une seul erreur. [IMG]http://i.gyazo.com/46d717332eabfd508f2f31b13b203502.png[/IMG] Ne vous en faites pas elle partira seul après. Ensuite à l'ouverture de la Form on veut bien ne pas avoir à retaper notre pseudo et le serveur de chat ? Alors il faut mettre ce code à l'ouverture de la form ( double clique dessus ) [CODE] If My.Settings.strName <> "" Then PseudoTXT.Text = My.Settings.strName End If If My.Settings.strChatSite <> "" Then ServeurTXT.Text = My.Settings.strChatSite End If [/CODE] [IMG]http://i.gyazo.com/6f75dd2d2a27499db7da7a342ef25cb7.png[/IMG] Voila donc pour la Form de connexion c'est finit ! On passe donc à la Form de chat qui s'appelle donc : Form2. Voila une image qui montre comment ajouter une form : [IMG]http://i.gyazo.com/47594e3358619fc74d491862e2f96a49.gif[/IMG] Ensuite voila il n'y a plus d'erreur :) Donc il faut re déclarer l'utilisation de l'assembly et la fonction API. Je ne redirais pas comment faire. Voila le design à faire : [IMG]http://i.gyazo.com/2864296aed0d98c40fb01a3f19132b19.png[/IMG] Donc pour ajouter la ScrollBars sur la textbox du chat voila comment faire [IMG]http://i.gyazo.com/059bf0c048bab707fe5202b60ada333d.gif[/IMG] Puis on ajoute 2 timers : [LIST=1] [*]" Timer1 " [*]" tmrBan " [/LIST] Donc on va commencé simplement par le code du bouton : [CODE] If API.SendMessage(API.strUsername, txtMessage.Text) = True Then API.UpdateChat(txtChat) txtMessage.Text = "" Else MessageBox.Show("Message non envoyé.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information) End If [/CODE] Puis comme tout à l'heure on met le code à l'ouverture de la Form. [CODE] API.strUsername = Form1.PseudoTXT.Text API.strChatSite = Form1.ServeurTXT.Text API.strIP = API.GetIP API.UpdateChat(txtChat) txtChat.SelectionStart = txtChat.TextLength txtChat.ScrollToCaret() Timer1.Start() [/CODE] [SIZE=1]Key de la source : Wv64VEvvjsNI5SqyQH2kqGii_HNk9gZRQqfKkhgPSCs [/SIZE] Ensuite ce code à la fermeture [ TRÈS IMPORTANT ] Si vous ne le mettez pas le chat croira que l'utilisateur est encore en ligne donc impossible de ce re connecter avec le même pseudo mit à part en vidant le FTP et re upload. [CODE] API.DeleteUser(API.strUsername) Form1.Show() [/CODE] [IMG]http://i.gyazo.com/f30dd25c84de693a515051fa18fa76e7.png[/IMG] Voila ensuite votre compte sera fermer vous pourrez utilisé le même pseudo la prochaine fois. Donc ensuite le code dans le KeyUp de la textbox message ( voila comment faire ) [IMG]http://i.gyazo.com/f275a721719334beb3e1c7a1b5ad2eba.gif[/IMG] [CODE] If e.KeyCode = Keys.Enter Then If API.SendMessage(API.strUsername, txtMessage.Text) = True Then API.UpdateChat(txtChat) txtMessage.Text = "" Else MessageBox.Show("Message non envoyé.", "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Information) End If End If [/CODE] Donc ensuite pour refresh le texte du chat on met ceci dans le timer1 : [CODE] API.UpdateChat(txtChat) [/CODE] Ensuite dans le timer ban vous mettez sa : [CODE] If API.IsBanned(API.strUsername) = True Then Me.Close() Form1.Show() MessageBox.Show("Compte bannis", "Banned", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End If If API.IPisRequested = True And API.GetRequestedIP <> API.strIP Then If API.WriteIP(API.strIP) = True Then End If End If [/CODE] Ensuite dans le changement de texte de la textbox du chat ( double clique dessus ) vous mettez : [CODE] txtChat.SelectionStart = txtChat.TextLength txtChat.ScrollToCaret() [/CODE] [CENTER][IMG]http://image.noelshack.com/fichiers/2014/32/1407685278-ligne.png[/IMG] [IMG]http://image.noelshack.com/fichiers/2014/32/1407687234-finish.png[/IMG] [FONT=Open sans condensed][COLOR=#2C3E50]FIN DU TUTORIEL[/COLOR][/FONT][/CENTER] [B][COLOR=#2c3e50]Merci à tous[/COLOR][/B][COLOR=#000000] d'avoir lu ce tutoriel, je vous dis à très bientôt pour de [/COLOR][B][COLOR=#2c3e50]prochains tutoriels[/COLOR][/B][COLOR=#000000] ! :tchuss:[/COLOR] [RIGHT][COLOR=#000000]Sujet rédigé [/COLOR][U][B][COLOR=#2c3e50]entièrement[/COLOR][/B][/U][COLOR=#000000] par [/COLOR][B][COLOR=#2C3E50]Boosterz GTP[/COLOR][/B][/RIGHT] [CENTER][COLOR=#000000][URL='http://reality-gaming.fr/teams/good-topic-premium.43/'][IMG]http://image.noelshack.com/fichiers/2014/32/1407687168-gtpend.png[/IMG][/URL] [/COLOR][/CENTER] [/QUOTE]
Insérer les citations…
Vérification
Publier la réponse
Forums
Forums généraux
RealityGaming
CRÉER SON PROPRE CHAT [VB.NET]
Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies.
Acceptez
En savoir plus.…
Haut