I am developing a LAN messenger in c# using sockets, i want to use XML for entire communication, can you people help me? or give me some link or code snippet?
any help will be appreciated
thanks in advance
You say you want to use XML for communication? In what sense? What you send over the socket needs to be converted into bytes. So build your XML in memory, then convert that into a byte array and send it over your socket and rebuild it at the other end.
There is no function to send XML over a socket.
An alternative is to use WCF. Lots of information about WCF can be found in the MSDN
@ Ketsuekiame
yes you are right brother, server will communicate with all clients, and the message will be broken in bytes, but i want to use XML to transmit these bytes to clients. :-)
Well if you need to use XML as your "message" then how about something like this as your markup...
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ClientMessage>
<SourceClientId>SomeIdHere</SourceClientId>
<ClientCommand>Message</ClientCommand>
<TargetClients>
<Client>TargetClientOne</Client>
<Client>TargetClientTwo</Client>
</TargetClients>
<Data>Whatever the message is here</Data>
</ClientMessage>
Obviously you would need a DTD that also matches this and the DTD should cover a message that is either from a client or a server. This is just to give you an idea.
Once you have the XML, you can serialise it into a byte stream fairly easily. Look into the BinaryFormatter
Dear Friends, I am facing a problem, I have two forms,
Form1 Has one DataGrideview and Button redirect to Form2, which has Button(Browse Excel File) and combobox(Sheet No of excel ...