Click here to Skip to main content
15,900,724 members
Home / Discussions / C#
   

C#

 
GeneralRe: end (break) Pin
SVb.net28-Mar-07 6:38
SVb.net28-Mar-07 6:38 
QuestionHow could i dispose a windows form. Pin
Test27030727-Mar-07 3:40
Test27030727-Mar-07 3:40 
AnswerRe: How could i dispose a windows form. Pin
Martin#27-Mar-07 3:44
Martin#27-Mar-07 3:44 
GeneralRe: How could i dispose a windows form. Pin
Test27030727-Mar-07 3:53
Test27030727-Mar-07 3:53 
AnswerRe: How could i dispose a windows form. Pin
Christian Graus27-Mar-07 3:48
protectorChristian Graus27-Mar-07 3:48 
GeneralRe: How could i dispose a windows form. Pin
Test27030727-Mar-07 4:06
Test27030727-Mar-07 4:06 
GeneralRe: How could i dispose a windows form. Pin
Christian Graus27-Mar-07 4:23
protectorChristian Graus27-Mar-07 4:23 
GeneralSending UDP packets Pin
V.27-Mar-07 3:40
professionalV.27-Mar-07 3:40 
Guys,

consider following code:
byte [] bytes = new byte[160];
FillBytes(ref bytes);
System.Net.IPAddress ipaddress = new System.Net.IPAddress(1684300900);  //=100.100.100.100
System.Net.IPEndPoint ipendpoint = new System.Net.IPEndPoint(ipaddress, 7000);
//System.Net.IPEndPoint remoteendpoint = new System.Net.IPEndPoint(ipaddress, 7001);
udpclient = new UdpClient();
try{
    int sent  = 0;
    //udpclient.Connect(ipendpoint);
    //udpclient.EnableBroadcast = true;
        //udpclient.Client.Connect(ipendpoint);
    //udpclient.Connect(ipendpoint);
    //sent = udpclient.Send(bytes, bytes.Length);
    sent = udpclient.Send(bytes, bytes.Length, SystemInformation.ComputerName, 7000);
    MessageBox.Show(Encoding.ASCII.GetString(bytes));
    //sent = udpclient.Send(bytes, bytes.Length, ipendpoint);
    lbl_bytessent.Text = "Sent: " + sent;
    //udpclient.Client.Close();
}
catch(Exception ex){
    MessageBox.Show("send result: error: " + ex.Message);
}


PS: I left the comments to show what I've already tried Smile | :)

I need to send some bytes to a receiving application. I have a small example in VB6 where it seems to work, so I tried in C# to do the same. The bytes that are sent (is set in integer sent) is always correct, the function doesn't come in the catch. However, the receiving application does not seem to react, but it does so with the VB6 application. I'm guessing I need to set some relation between sender and receiver, but I can't figure out how.

Any help on this? According to the examples on MSDN, I'm quite correct?

Thanks !


V.
I found a living worth working for, but haven't found work worth living for.

QuestionWindows Forms Pin
7127-Mar-07 3:22
7127-Mar-07 3:22 
AnswerRe: Windows Forms Pin
Christian Graus27-Mar-07 3:35
protectorChristian Graus27-Mar-07 3:35 
GeneralRe: Windows Forms Pin
Martin#27-Mar-07 3:40
Martin#27-Mar-07 3:40 
AnswerRe: Windows Forms Pin
Martin#27-Mar-07 3:36
Martin#27-Mar-07 3:36 
QuestionLarge TXT files Pin
Sabry190527-Mar-07 3:04
Sabry190527-Mar-07 3:04 
AnswerRe: Large TXT files Pin
Christian Graus27-Mar-07 3:13
protectorChristian Graus27-Mar-07 3:13 
AnswerRe: Large TXT files Pin
hakonvik27-Mar-07 3:22
hakonvik27-Mar-07 3:22 
GeneralRe: Large TXT files Pin
Christian Graus27-Mar-07 3:36
protectorChristian Graus27-Mar-07 3:36 
GeneralRe: Large TXT files Pin
Sabry190527-Mar-07 5:12
Sabry190527-Mar-07 5:12 
GeneralRe: Large TXT files Pin
Dan Neely27-Mar-07 5:24
Dan Neely27-Mar-07 5:24 
GeneralRe: Large TXT files Pin
Sabry190527-Mar-07 5:51
Sabry190527-Mar-07 5:51 
GeneralRe: Large TXT files Pin
Dan Neely27-Mar-07 6:52
Dan Neely27-Mar-07 6:52 
AnswerUse a FileStream Pin
Ennis Ray Lynch, Jr.27-Mar-07 5:14
Ennis Ray Lynch, Jr.27-Mar-07 5:14 
QuestionMotorola S-Record file to Binary file Pin
-=gix=-27-Mar-07 2:02
-=gix=-27-Mar-07 2:02 
AnswerRe: Motorola S-Record file to Binary file Pin
Colin Angus Mackay27-Mar-07 2:25
Colin Angus Mackay27-Mar-07 2:25 
GeneralRe: Motorola S-Record file to Binary file Pin
-=gix=-27-Mar-07 3:10
-=gix=-27-Mar-07 3:10 
GeneralRe: Motorola S-Record file to Binary file Pin
Colin Angus Mackay27-Mar-07 12:35
Colin Angus Mackay27-Mar-07 12:35 

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.