SendString("<html>\n\n\t<meta http-equiv=\"Refresh\" content=\"0; url=" + Index + "\">\n\n</html>", Client, "200 OK"); //if client connects, then Server sends automatically index page string[] row = { DateTime.Now.ToString(), Client.Client.RemoteEndPoint.ToString(), "Külastas (külastas means visited in English) :" + URL, "200" }; // 200 means code 200 OK var listViewItem = new ListViewItem(row); listView1.Items.Add(listViewItem); listViewItem.ForeColor = Color.Lime; return; // but if client's IP is the same as IP in listView2, it should send string "You are blocked" or sth. like that. BUT THE PROBLEM IS: // 1) blocked IP list has IP's like "1.2.3.4" , but RemoteEndPoint IP is like "1.2.3.4:12345) //these are totally different, if I want to block an IP, I won't put down all the different ports... // so how do I get ONLY the IP from remoteendpoint, not ports // 2) if I get the (only)IP(not port) then server should compare the IP with blocked IP list.If Client's IP is listed in blocked IP list (listView2), then it sends string SendString(keelatud,Client,"banned") Thanks! hope you understood!
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)