Click here to Skip to main content
15,917,061 members
Home / Discussions / C#
   

C#

 
AnswerRe: GDI Get Painted Points Pin
Saksida Bojan19-Dec-09 7:00
Saksida Bojan19-Dec-09 7:00 
GeneralRe: GDI Get Painted Points Pin
dataminers19-Dec-09 7:38
dataminers19-Dec-09 7:38 
GeneralRe: GDI Get Painted Points Pin
Dave Kreskowiak19-Dec-09 8:18
mveDave Kreskowiak19-Dec-09 8:18 
GeneralRe: GDI Get Painted Points Pin
OriginalGriff19-Dec-09 23:11
mveOriginalGriff19-Dec-09 23:11 
GeneralRe: GDI Get Painted Points Pin
Dave Kreskowiak20-Dec-09 3:01
mveDave Kreskowiak20-Dec-09 3:01 
QuestionHow to get all IPs from LAN environment. Pin
Md. Marufuzzaman19-Dec-09 3:55
professionalMd. Marufuzzaman19-Dec-09 3:55 
AnswerRe: How to get all IPs from LAN environment. Pin
dan!sh 19-Dec-09 5:42
professional dan!sh 19-Dec-09 5:42 
GeneralRe: How to get all IPs from LAN environment. Pin
Md. Marufuzzaman19-Dec-09 5:46
professionalMd. Marufuzzaman19-Dec-09 5:46 
QuestionHelp me! Datetimepicker Pin
tphung.hue19-Dec-09 2:27
tphung.hue19-Dec-09 2:27 
AnswerRe: Help me! Datetimepicker Pin
PIEBALDconsult19-Dec-09 4:17
mvePIEBALDconsult19-Dec-09 4:17 
AnswerRe: Help me! Datetimepicker Pin
Saksida Bojan19-Dec-09 6:50
Saksida Bojan19-Dec-09 6:50 
AnswerRe: Help me! Datetimepicker Pin
Saksida Bojan19-Dec-09 8:40
Saksida Bojan19-Dec-09 8:40 
GeneralRe: Help me! Datetimepicker Pin
PIEBALDconsult19-Dec-09 17:31
mvePIEBALDconsult19-Dec-09 17:31 
Questionlan messenger Pin
rawatsunil9218-Dec-09 22:24
rawatsunil9218-Dec-09 22:24 
AnswerRe: lan messenger Pin
OriginalGriff18-Dec-09 22:35
mveOriginalGriff18-Dec-09 22:35 
AnswerRe: lan messenger Pin
dataminers19-Dec-09 8:04
dataminers19-Dec-09 8:04 
CLIENT

SendMessageToClient("192.168.1.3", 8080, textBox1.Text);

private void SendMessageToClient(string pIP, int pPort, string pMessage)
{
try
{
TcpClient tcpClient = new TcpClient();
tcpClient.Connect(new System.Net.IPEndPoint(System.Net.IPAddress.Parse(pIP), pPort));
NetworkStream networkStream = tcpClient.GetStream();
StreamWriter streamWriter = new StreamWriter(networkStream);

streamWriter.WriteLine(pMessage);
streamWriter.Flush();

streamWriter.Close();
networkStream.Close();
}
catch (Exception exception)
{
throw exception;
}
}

--------------------------------------------------------------------------------------------

SERVER

Thread thread = new Thread(new ThreadStart(ListenForSocket));
thread.IsBackground = true;
thread.Start();

private static void ListenForSocket()
{
TcpListener tcpListener = new TcpListener(new System.Net.IPEndPoint(System.Net.IPAddress.Parse("192.168.1.3"), 8080));
tcpListener.Start();

while (true)
{
Socket m_ClientSocket = tcpListener.AcceptSocket();

if (!m_ClientSocket.Connected)
throw new Exception("Not Connect");


NetworkStream networkStream = new NetworkStream(m_ClientSocket);
StreamReader streamReader = new StreamReader(networkStream);

try
{
string message = streamReader.ReadLine();
MessageBox.Show(message);
}
catch (Exception exception)
{
throw exception;
}
}
}
QuestionHow to find the path of a PDF based on corresponding URL opened in IE? Pin
svt gdwl18-Dec-09 19:24
svt gdwl18-Dec-09 19:24 
AnswerRe: How to find the path of a PDF based on corresponding URL opened in IE? Pin
Luc Pattyn19-Dec-09 0:30
sitebuilderLuc Pattyn19-Dec-09 0:30 
Questionhow to write a object data into a file? Pin
santhosh-padamatinti18-Dec-09 19:18
santhosh-padamatinti18-Dec-09 19:18 
AnswerRe: how to write a object data into a file? Pin
dan!sh 18-Dec-09 19:44
professional dan!sh 18-Dec-09 19:44 
AnswerRe: how to write a object data into a file? Pin
OriginalGriff18-Dec-09 22:03
mveOriginalGriff18-Dec-09 22:03 
GeneralRe: how to write a object data into a file? Pin
santhosh-padamatinti19-Dec-09 0:13
santhosh-padamatinti19-Dec-09 0:13 
Questionsocket connection when Messenger behind router Pin
s196675m18-Dec-09 13:09
s196675m18-Dec-09 13:09 
AnswerRe: socket connection when Messenger behind router Pin
Migounette18-Dec-09 13:17
Migounette18-Dec-09 13:17 
Questionhow to send mail with hyperlink and values Pin
treuveni18-Dec-09 10:57
treuveni18-Dec-09 10:57 

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.