Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
Questionhow do I read a files' or assemblys' metadata (date modified, assembly version, etc.) Pin
AfzalHassen18-Jan-06 1:20
AfzalHassen18-Jan-06 1:20 
AnswerRe: how do I read a files' or assemblys' metadata (date modified, assembly version, etc.) Pin
Werdna18-Jan-06 7:25
Werdna18-Jan-06 7:25 
AnswerRe: how do I read a files' or assemblys' metadata (date modified, assembly version, etc.) Pin
munishsehgal22-Jan-06 1:14
munishsehgal22-Jan-06 1:14 
GeneralRe: how do I read a files' or assemblys' metadata (date modified, assembly version, etc.) Pin
AfzalHassen22-Jan-06 19:35
AfzalHassen22-Jan-06 19:35 
QuestionQuestions on TextBox control Pin
bouli18-Jan-06 0:55
bouli18-Jan-06 0:55 
AnswerRe: Questions on TextBox control Pin
Sheel Gohe18-Jan-06 1:12
Sheel Gohe18-Jan-06 1:12 
GeneralRe: Questions on TextBox control Pin
bouli18-Jan-06 5:05
bouli18-Jan-06 5:05 
Questiongetting client ip Pin
Ankit Aneja18-Jan-06 0:41
Ankit Aneja18-Jan-06 0:41 
this is my class code
i wan't to get ip address of each client which is getting connected

listen class

public class listen
{
TcpListener server=null;
Thread tcpthread=null;
client[] cl=new client[3];

public listen()
{
//
// TODO: Add constructor logic here
//
}
public void startlisten()
{
Int32 port = 3310;
IPAddress localAddr = IPAddress.Parse("192.168.0.6");

// TcpListener server = new TcpListener(port);
server = new TcpListener(localAddr, port);

// Start listening for client requests.
server.Start();


// Enter the listening loop.
for(int i=0;i<3;i++)
{
cl[i]=new client();
cl[i].status=true;
}

Boolean flag;
while(true)
{
try
{
flag=false;
// Perform a blocking call to accept requests.
// You could also user server.AcceptSocket() here.
for(int i=0;i<3;i++)
{
if(cl[i].status==true)
{
cl[i]= new client(serverAcceptTcpClient());
tcpthread=new Thread(new ThreadStart(cl[i].getClient));
tcpthread.Start();
flag=true;
break;
}
}
if(flag!=true)
{
//MessageBox.Show("All Clients Busy");

}




}
catch(Exception se)
{

}
}

}
public void stoplisten()
{
server.Stop();
}
}



client class
public class client
{
TcpClient tcpClient;
public Boolean status;
// Buffer for reading data
Byte[] bytes = new Byte[256];
String data = null;
IPAddress localAddr = IPAddress.Parse("192.168.0.6");

public client()
{ //
// TODO: Add constructor logic here
//
//status=true;
}
public client(TcpClient Client)
{
tcpClient =Client;
//
// TODO: Add constructor logic here
//
status=false;
}
public void getClient()
{
try
{
data = null;
// Get a stream object for reading and writing
NetworkStream stream = tcpClient.GetStream();
int i;
// Loop to receive all the data sent by the client.
while((i = stream.Read(bytes, 0, bytes.Length))!=0)
{
// Translate data bytes to a ASCII string.
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
// Process the data sent by the client.
string replyMsg = data;
clamdCommand x=new clamdCommand();
replyMsg=x.Command(replyMsg);
int lowerport=int.Parse(ConfigurationSettings.AppSettings.Get("lowerport"));
int upperport=int.Parse(ConfigurationSettings.AppSettings.Get("upperport"));
for(int y=lowerport;y
GeneralRe: getting client ip Pin
Guffa18-Jan-06 1:21
Guffa18-Jan-06 1:21 
GeneralRe: getting client ip Pin
Ankit Aneja18-Jan-06 1:26
Ankit Aneja18-Jan-06 1:26 
AnswerRe: getting client ip Pin
Guffa24-Jan-06 23:05
Guffa24-Jan-06 23:05 
Questionhelp me plssssssssssssss Pin
willsgeorge18-Jan-06 0:41
willsgeorge18-Jan-06 0:41 
AnswerRe: help me plssssssssssssss Pin
Sheel Gohe18-Jan-06 1:22
Sheel Gohe18-Jan-06 1:22 
QuestionCrystal reports sharing Pin
robmays18-Jan-06 0:24
robmays18-Jan-06 0:24 
Questionvideo playing Pin
sa maq18-Jan-06 0:05
sa maq18-Jan-06 0:05 
QuestionHow to Extract a Key ScanCode in WndProc Pin
redfish3417-Jan-06 23:07
redfish3417-Jan-06 23:07 
AnswerGOT IT! Shooting 2 for 2! Pin
redfish3418-Jan-06 17:09
redfish3418-Jan-06 17:09 
GeneralRe: GOT IT! Shooting 2 for 2! Pin
Dan Neely19-Jan-06 2:18
Dan Neely19-Jan-06 2:18 
Questionwana read a binary file and display its data into text file Pin
geek-age17-Jan-06 22:30
geek-age17-Jan-06 22:30 
AnswerRe: wana read a binary file and display its data into text file Pin
Guffa17-Jan-06 22:53
Guffa17-Jan-06 22:53 
GeneralRe: wana read a binary file and display its data into text file Pin
geek-age17-Jan-06 23:10
geek-age17-Jan-06 23:10 
AnswerRe: wana read a binary file and display its data into text file Pin
Guffa18-Jan-06 0:32
Guffa18-Jan-06 0:32 
Questionusing javascript and xml Pin
imsathy17-Jan-06 21:50
imsathy17-Jan-06 21:50 
QuestionDatagridview determine if row is a new row Pin
CandyMe17-Jan-06 21:47
CandyMe17-Jan-06 21:47 
AnswerRe: Datagridview determine if row is a new row Pin
sathish s17-Jan-06 22:33
sathish s17-Jan-06 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.