I written the following to broadcast a data in a Windows Application using C#
UdpClient server = new UdpClient("127.0.0.1", 9050);
string welcome = "Hello, are you there?";
data = Encoding.ASCII.GetBytes(welcome);
开发者_如何学C server.Send(data, data.Length);
But, How can I read the same data by a web application using javascript or asp.net?
You can do this via a webservice or wcf service. Javascript can be serialized into JSON. Have a look at the json website to check out the syntax. I have used JQuery to do the ajax communication to call the webservice in the past. The all you need to do to convert this back to a javascript object is
var myObject = eval(myTransferObject)
精彩评论