!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
Go Back  Xtreme Visual Basic Talk > > > !!!!!!!Chat Server Help!!!!!!


Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2004, 01:07 PM
VisionKeys VisionKeys is offline
Newcomer
 
Join Date: Apr 2004
Posts: 2
Question !!!!!!!Chat Server Help!!!!!!


Ok Look Im Having A Problem On Making A Ban To Add To Ban List I Got The Disconnecting User Working Is There AnyWay Of Adding A Ban Or Banning User From Using Listview


Code:
 (Disconnecting User)
On Error Resume Next
    If Not Users.SelectedItem Is Nothing Then
        frmServer.sockServer(CInt(Users.SelectedItem.SubItems(1))).Close
        frmServer.sockServer_Close CInt(Users.SelectedItem.SubItems(1))
    Else
        MsgBox "No User Selected To Disconnect", vbOKOnly, "Disconnect User"
    End If
End Sub


Also How Can I Send POpup Message Boxes To User On Client Like I Can Type Anything In A TextBox Then Send


And Other Thing How Can Get User ip Using ListView And How Can I Also Um Send Messages Into A Pm Or Chat
Reply With Quote
  #2  
Old 04-28-2004, 01:47 PM
Render's Avatar
Render Render is offline
Junior Contributor
 
Join Date: Nov 2002
Location: USA
Posts: 398
Default

I actually just made a similar program. To notify the user that they are being disconnected i used something like this:

Code:
'server Winsock(SockIndex).SendData "100 MYMESSAGE" DoEvents 'client Private Sub Winsock_DataArrival(Index As Integer, ByVal bytesTotal As Long) Winsock(SockIndex).GetData strData, vbString 'GET DATA Prefix= Left(strData, 3) 'GET MSG PREFIX Message = Right(strData, Len(strData) - 4) 'GET MSG W/O PREFIX Select Case Prefix Case 100 msgbox Message 'close sock Case ..... End Select End Sub

The reason for the prefix is so it can be "filtered" by the client. If the first 3 numbers are 100, then the client will close its connection. You could also have a message with a prefix of 200 which starts an app on the remote machine. Just put a Shell command under the 200 in that Select Case code. Anyway this is just an example of the way i did it.

To get the IP of the remote client, just use Winsock(Index).RemoteIP

Last edited by herilane; 04-28-2004 at 03:17 PM. Reason: fixed closing [/vb] tag
Reply With Quote
  #3  
Old 04-28-2004, 03:23 PM
VisionKeys VisionKeys is offline
Newcomer
 
Join Date: Apr 2004
Posts: 2
Default

Winsock(Index).RemoteIP <--Right How Can I put it in a command and i click it should select user from listview and popup the ip in a msgbox ... but also how can i add a ban to the listview ......... like add there ip or user to the listview and they try to connect they get kickoff with a message
Reply With Quote
  #4  
Old 04-28-2004, 08:28 PM
Render's Avatar
Render Render is offline
Junior Contributor
 
Join Date: Nov 2002
Location: USA
Posts: 398
Default

One way of doing it would be to create an array which holds the user information.

[vb]
Dim UserInfo() as String

Public Sub GetFreeSlot()
For i = 1 To UBound(UserInfo) 'LOOP SLOTS
If UserInfo(i) = "" Then 'IF FREE THEN...
UserInfo(i) = USER IP 'ASSIGN ARRAY SLOT
Exit For
End If
Next i 'NEXT SLOT
End Sub
[vb/]

You could then add a column in your ListView and loop through the UserInfo array and add it to the listview. When you select an item from the listview it could check the value of the new column and match it to the contents of the array. Sorry this isant very clear but i dont know how else to explain it.

As for banning a user, you would have to create a file or listbox with the banned ip addresses. You could loop through the listbox to see if the RemoteIP matches any of the listitems.
Reply With Quote
  #5  
Old 04-29-2004, 10:20 AM
Timot Timot is offline
Centurion
 
Join Date: Feb 2004
Posts: 178
Default Banning Users

I have it set up where the server will create a file called 'bannedips.txt' and when I want to ban someone, I open up that file and record their ip address in there, then save it. The server will refresh the banned list and display the ip address that have been recorded.

When the user tries to log on, they recieve a message "You have been banned!"

In my opinion, that's kinda hard. I'm going to try to figure out how I could click a button and the server will write the ip address in the file and save it.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
chat server shawn Communications 3 06-19-2003 01:23 AM
Chat Server Tutorial? Geuis Miscellaneous Languages 1 03-12-2003 10:46 AM
Q's re. usage of SQL Server Mike Database and Reporting 6 07-02-2002 07:44 PM
Chat server Floppy Communications 8 05-29-2002 10:41 AM
Client server chat problem cballe Communications 2 05-29-2002 08:20 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!! !!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
 
!!!!!!!Chat Server Help!!!!!!
!!!!!!!Chat Server Help!!!!!!
 
-->