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

C#

 
GeneralRe: Get a list of System Font Sizes Pin
hardsoft10-Sep-09 0:51
hardsoft10-Sep-09 0:51 
GeneralRe: Get a list of System Font Sizes Pin
xirisjohn30-May-11 6:17
xirisjohn30-May-11 6:17 
AnswerRe: Get a list of System Font Sizes Pin
carlecomm22-Sep-09 16:06
carlecomm22-Sep-09 16:06 
QuestionPrint with two printers ? Pin
Mohammad Dayyan9-Sep-09 11:36
Mohammad Dayyan9-Sep-09 11:36 
AnswerRe: Print with two printers ? Pin
Christian Graus9-Sep-09 11:40
protectorChristian Graus9-Sep-09 11:40 
AnswerRe: Print with two printers ? Pin
Zoki Manas9-Sep-09 21:00
Zoki Manas9-Sep-09 21:00 
QuestionMultithread UDP listener in C# Pin
Christian_V_V9-Sep-09 11:35
Christian_V_V9-Sep-09 11:35 
AnswerRe: Multithread UDP listener in C# Pin
carlecomm22-Sep-09 15:51
carlecomm22-Sep-09 15:51 
this is codes from web:


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;
using System.Net.Sockets;
using System.Threading;

namespace BroadcastExample
{
public partial class Form1 : Form
{
delegate void AppendStringCallback(string text);
AppendStringCallback appendstringcallback;
//Port 51008
/// <summary>
///
/// </summary>
private int port = 51008;

/// <summary>
///
/// </summary>
private UdpClient udpclient;

public Form1()
{
InitializeComponent();
appendstringcallback = new AppendStringCallback(AppendString);
}

/// <summary>
///
/// </summary>
/// <param name="text"></param>
private void AppendString(string text)
{
if (richtextBox2.InvokeRequired == true)
{
this.Invoke(appendstringcallback, text);
}
else
{
richtextBox2.AppendText(text + "\r\n");
}
}

/// <summary>
///
/// </summary>
private void RecData()
{

udpclient = new UdpClient(port);
IPEndPoint remote = null;

while (true)
{
try
{
byte[] bytes = udpclient.Receive(ref remote);
string str = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
AppendString(string.Format("From{0}:{1}", remote, str));
}
catch
{

break;
}
}
}

private void Form1_Load(object sender, EventArgs e)
{

Thread mythread = new Thread(new ThreadStart(RecData));

mythread.IsBackground = true;
mythread.Start();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
udpclient.Close();
}

private void button1_Click(object sender, EventArgs e)
{
UdpClient myUdpclient = new UdpClient();


try
{
IPEndPoint iep = new IPEndPoint(IPAddress.Broadcast, port);
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(textBox1.Text);
myUdpclient.Send(bytes, bytes.Length, iep);
textBox1.Clear();
myUdpclient.Close();
textBox1.Focus();
}
catch (Exception err)
{
MessageBox.Show(err.Message, "Failed");
}
finally
{
myUdpclient.Close();
}
}
}
}

modified 27-May-14 5:31am.

AnswerRe: Multithread UDP listener in C# Pin
Prajakta Bhagwat7-Dec-11 19:23
Prajakta Bhagwat7-Dec-11 19:23 
QuestionWebBrowser ? Pin
Mohammad Dayyan9-Sep-09 9:34
Mohammad Dayyan9-Sep-09 9:34 
AnswerRe: WebBrowser ? Pin
Christian Graus9-Sep-09 9:38
protectorChristian Graus9-Sep-09 9:38 
GeneralRe: WebBrowser ? Pin
Mohammad Dayyan9-Sep-09 9:40
Mohammad Dayyan9-Sep-09 9:40 
GeneralRe: WebBrowser ? Pin
OriginalGriff9-Sep-09 9:48
mveOriginalGriff9-Sep-09 9:48 
GeneralRe: WebBrowser ? Pin
Mohammad Dayyan9-Sep-09 10:11
Mohammad Dayyan9-Sep-09 10:11 
AnswerRe: WebBrowser ? Pin
carlecomm22-Sep-09 16:14
carlecomm22-Sep-09 16:14 
QuestionTry-Catch problem in C# console app Pin
Member 46458019-Sep-09 9:05
Member 46458019-Sep-09 9:05 
AnswerRe: Try-Catch problem in C# console app Pin
Christian Graus9-Sep-09 9:15
protectorChristian Graus9-Sep-09 9:15 
AnswerRe: Try-Catch problem in C# console app Pin
harold aptroot9-Sep-09 9:19
harold aptroot9-Sep-09 9:19 
GeneralRe: Try-Catch problem in C# console app Pin
Member 46458019-Sep-09 9:27
Member 46458019-Sep-09 9:27 
GeneralRe: Try-Catch problem in C# console app Pin
harold aptroot9-Sep-09 9:28
harold aptroot9-Sep-09 9:28 
GeneralRe: Try-Catch problem in C# console app Pin
Christian Graus9-Sep-09 9:39
protectorChristian Graus9-Sep-09 9:39 
AnswerRe: Try-Catch problem in C# console app Pin
Zoki Manas9-Sep-09 20:46
Zoki Manas9-Sep-09 20:46 
AnswerRe: Try-Catch problem in C# console app Pin
carlecomm22-Sep-09 16:00
carlecomm22-Sep-09 16:00 
QuestionPowerpoint using c# Pin
Vijay Mudunuri9-Sep-09 7:59
Vijay Mudunuri9-Sep-09 7:59 
AnswerRe: Powerpoint using c# Pin
Manas Bhardwaj9-Sep-09 8:30
professionalManas Bhardwaj9-Sep-09 8:30 

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.