Click here to Skip to main content
15,904,153 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help simple string passing :( Pin
BambooMoon3-Nov-04 6:26
BambooMoon3-Nov-04 6:26 
GeneralInstrumentation Pin
mathon2-Nov-04 8:28
mathon2-Nov-04 8:28 
GeneralRe: Instrumentation Pin
kayhustle2-Nov-04 9:19
kayhustle2-Nov-04 9:19 
GeneralRe: Instrumentation Pin
mathon2-Nov-04 10:02
mathon2-Nov-04 10:02 
GeneralRe: Instrumentation Pin
Dave Kreskowiak3-Nov-04 3:35
mveDave Kreskowiak3-Nov-04 3:35 
GeneralRe: Instrumentation Pin
mathon3-Nov-04 6:35
mathon3-Nov-04 6:35 
GeneralRe: Instrumentation Pin
Dave Kreskowiak3-Nov-04 11:40
mveDave Kreskowiak3-Nov-04 11:40 
GeneralMSDN UDP Sample does not run Pin
win32wiz2-Nov-04 7:49
win32wiz2-Nov-04 7:49 
The following code compiles fine but when attempting to run it from debug mode, the compiler breaks on "Send(args[0]);" And generates the following exception:
An unhandled exception of 'System.IndexOutOfRangeException' occurred in UDPSender01.exe
Additional information: Index was outside the bounds of the array.

This project was setup as a simple c# console.

using System;
using System.Net;
using System.Net.Sockets;
using System.Text;

public class UDPMulticastSender
{

private static readonly IPAddress GroupAddress =
IPAddress.Parse("224.168.100.2");
private static int GroupPort = 11000;

private static void Send( String message)
{
UdpClient sender = new UdpClient();
IPEndPoint groupEP = new IPEndPoint(GroupAddress,GroupPort);

try
{
Console.WriteLine("Sending datagram : {0}", message);
byte[] bytes = Encoding.ASCII.GetBytes(message);

sender.Send(bytes, bytes.Length, groupEP);

sender.Close();

}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}

}

public static int Main(String[] args)
{
Send(args[0]);

return 0;
}
}

Thanks,
Moe




GeneralRe: MSDN UDP Sample does not run Pin
Charlie Williams2-Nov-04 8:32
Charlie Williams2-Nov-04 8:32 
QuestionClearing device with alpha? Pin
Jaran Nilsen2-Nov-04 6:48
Jaran Nilsen2-Nov-04 6:48 
QuestionHowto Instantiate a class of unknown type? Pin
Member 14185452-Nov-04 6:37
Member 14185452-Nov-04 6:37 
AnswerRe: Howto Instantiate a class of unknown type? Pin
Nick Parker2-Nov-04 8:00
protectorNick Parker2-Nov-04 8:00 
GeneralLine Break Pin
goatstudio2-Nov-04 5:58
goatstudio2-Nov-04 5:58 
GeneralRe: Line Break Pin
kayhustle2-Nov-04 10:26
kayhustle2-Nov-04 10:26 
GeneralListView CheckBoxes Pin
mrlou882-Nov-04 5:42
mrlou882-Nov-04 5:42 
GeneralRe: ListView CheckBoxes Pin
mrlou882-Nov-04 6:09
mrlou882-Nov-04 6:09 
GeneralPanel doubt Pin
ee990352-Nov-04 5:32
ee990352-Nov-04 5:32 
GeneralRe: Panel doubt Pin
Michael P Butler2-Nov-04 5:52
Michael P Butler2-Nov-04 5:52 
GeneralRe: Panel doubt Pin
ee990352-Nov-04 5:56
ee990352-Nov-04 5:56 
GeneralRe: Panel doubt Pin
ee990352-Nov-04 6:59
ee990352-Nov-04 6:59 
GeneralBuild a panel class Pin
ee990352-Nov-04 4:09
ee990352-Nov-04 4:09 
GeneralRe: Build a panel class Pin
Stefan Troschuetz2-Nov-04 4:24
Stefan Troschuetz2-Nov-04 4:24 
GeneralRe: Build a panel class Pin
Luis Alonso Ramos2-Nov-04 12:22
Luis Alonso Ramos2-Nov-04 12:22 
GeneralReadonly in propertygrid with text color Pin
AlanJones2-Nov-04 3:33
AlanJones2-Nov-04 3:33 
Generalmoney data type Pin
webhay2-Nov-04 3:06
webhay2-Nov-04 3:06 

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.