hi GURUs my myself Vinod i am an amature in network programming as an assignment for my final year i have picked up LAN messenger actually there are many questions but 1st things 1st * HOW DO I GET THE NAMES AND IPADDRESS OF ALL THE COMPUTERS IN MY OFFICE????????????????? * Desperately waitin for ur reply n thx a million in advance :)
Vinziee
Posts
-
how to get a list of computer names in LAN -
Client and Server Programhey thx Sebastian ur soluion worked perfectly fine
-
Client and Server Programthx i used port 8080 n its working perfectly fine thx for ur help but now there is another problem is it possible to use the same udpclient object for sending as well as recieving data i mean if i create a UDPcleint object like void send() { UDPClient client = new UDPClient(); client.Connect(server, 8080); cleint.send(nedata); } void recieve() { UDPClient client = new UDPClient(); IpEndpoint ip = new IPEndponit(server, 8080) client.Recieve(ref ip) .... } void main() { thread thd_send = new thread(new threadStart(send)); thread thd_send = new thread(new threadStart(recieve)); } }
-
Client and Server Programso how am i supposed to know wether the port is already occupied by some other application and which other port can i use
-
Client and Server Programthx Mia Logan the actual problem lies with the server itself my client sends data properly but when i comes to receving the server throws an ecxception "the port can be used only once" this exception i'll check out msdn documentation of UDPClient as well thx for the advice
-
Client and Server Programhey sebastian thx for ur reply . i tried that it still says only one usage of each socket is allowed ************************the new code for server************************************************ using System; using System.Threading; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.Net; namespace server { public partial class Form1 : Form { UdpClient server; Thread thdserver; public Form1() { InitializeComponent(); } public void recieve() { try { server = new UdpClient(8080); while (true) { IPEndPoint ip = new IPEndPoint(IPAddress.Any, 0); byte[] recieved = server.Receive(ref ip); string returndata = Encoding.ASCII.GetString(recieved); listBox1.Items.Add(ip.Address.ToString() + " : " + returndata.ToString()); } } catch (SocketException ex) { MessageBox.Show(ex.Message); } } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { //recieve(); thdserver = new Thread(new ThreadStart(recieve)); thdserver.Start(); } private void button2_Click(object sender, EventArgs e) { server.Close(); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { server.Close(); } } } *********************the new code for client**************************************** using System; using System.Threading; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.Net; namespace ser_cli { public partial class Form1 : Form { UdpClient client = new UdpClient(); public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Thread th = new Thread(new ThreadStart(hear)); th.Sta
-
Validations of Username and Password feildhey dude what is selenium???:confused:
-
Client and Server Programhi musefan i tried googling but cudnt find proper ans if u cud help me with the coding then i wud be really grateful to you thx in advance
-
Client and Server Programhi SeMartens first of all thx for replyin but frankly speakin i checked out ur article but cudnt catch a word can u explain me in simpler words plzzzz.... .. help me with the solution
-
Client and Server ProgramA hi to all programming gurus i am an amature in network programming i have written an simple program for making a client and server in c# the cleint sends a msg and the server displays it in the listbox(lbconnections) The Problem is that---- this application runs perfectly after being deployed and afterward when i again use it it crashes (port already bieng used error) plz help me with this plzzzzzzzzzzzzzzzzzzzzzzzz..............:confused::confused::confused: ********************************coding for server******************************************* using System; using System.Threading; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.Net; namespace server { public partial class Form1 : Form { public Form1() { InitializeComponent(); } public void recieve() { try { UdpClient server = new UdpClient(8080); while (true) { IPEndPoint ip = new IPEndPoint(IPAddress.Any, 0); byte[] recieved = server.Receive(ref ip); string returndata = Encoding.ASCII.GetString(recieved); listBox1.Items.Add(ip.Address.ToString() + " : " + returndata.ToString()); } } catch (SocketException ex) { MessageBox.Show(ex.Message); } } private void Form1_Load(object sender, EventArgs e) { Thread server = new Thread(new ThreadStart(recieve)); server.Start(); } } } ***************************************CODING FOR CLIENT********************************************* using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Net.Sockets; using System.Net; namespace ser_cli { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { UdpClient client = new UdpClient(); client.Connect(tbHost.Text, 8080); byte[] send = Encoding.ASCII.GetBytes("HELLO WORLD?"); client.Send(send, s