Click here to Skip to main content
15,888,241 members
Home / Discussions / C#
   

C#

 
Questionsocket programing Pin
behzadcp12-Mar-09 5:03
professionalbehzadcp12-Mar-09 5:03 
AnswerRe: socket programing Pin
Teuz12-Mar-09 5:15
Teuz12-Mar-09 5:15 
AnswerRe: socket programing Pin
Michael Bookatz12-Mar-09 5:18
Michael Bookatz12-Mar-09 5:18 
AnswerRe: socket programing Pin
Xmen Real 12-Mar-09 5:19
professional Xmen Real 12-Mar-09 5:19 
AnswerRe: socket programing Pin
Member 349379912-Mar-09 6:30
Member 349379912-Mar-09 6:30 
QuestionRe: socket programing Pin
ky_rerun12-Mar-09 6:56
ky_rerun12-Mar-09 6:56 
AnswerRe: socket programing Pin
behzadcp12-Mar-09 7:47
professionalbehzadcp12-Mar-09 7:47 
QuestionXML Pin
mrithula812-Mar-09 4:50
mrithula812-Mar-09 4:50 
Hi I am sending the ip address and the port no for the socket using the following syntax:
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8050);
            Socket newsock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            newsock.Bind(ipep);
Because of the connection problem i want to read both the ip address and the port no from an xml file.I do not exactly know how i should be storing data in an xml...In the xml file named p1.xml i have given the following:Please check whether this is right and give me your suggestions
<table width="100%" border="0">

<tr>
<td><address>127.0.0.1<address>
<td>
<tr>

<tr><td>
<port>10001<port>
<td><tr>


I am using the following code for reading the data from the xml file:
XmlTextreader reader = new XmlTextReader("p1.xml");
            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Text: //Display the text in each element.
                        //   Console.WriteLine(reader.Value);
                     String s=reader.Value;
              }
}
My doubt is that will the string variable "s" take values of the ip and port..and how do i fit it into the socket statement...please help me with this
AnswerRe: XML [modified] Pin
harold aptroot12-Mar-09 5:03
harold aptroot12-Mar-09 5:03 
GeneralRe: XML Pin
mrithula813-Mar-09 0:16
mrithula813-Mar-09 0:16 
GeneralRe: XML Pin
mrithula813-Mar-09 5:40
mrithula813-Mar-09 5:40 
GeneralRe: XML Pin
harold aptroot13-Mar-09 5:50
harold aptroot13-Mar-09 5:50 
GeneralRe: XML Pin
mrithula813-Mar-09 6:57
mrithula813-Mar-09 6:57 
GeneralRe: XML Pin
harold aptroot13-Mar-09 7:33
harold aptroot13-Mar-09 7:33 
AnswerRe: XML Pin
Michael Bookatz12-Mar-09 5:17
Michael Bookatz12-Mar-09 5:17 
Questionrecieving error in this program Pin
Nettai12-Mar-09 4:45
Nettai12-Mar-09 4:45 
AnswerRe: recieving error in this program Pin
Teuz12-Mar-09 5:01
Teuz12-Mar-09 5:01 
GeneralRe: recieving error in this program Pin
Nettai12-Mar-09 5:14
Nettai12-Mar-09 5:14 
GeneralRe: recieving error in this program Pin
Teuz12-Mar-09 5:18
Teuz12-Mar-09 5:18 
GeneralRe: recieving error in this program Pin
#realJSOP12-Mar-09 5:41
mve#realJSOP12-Mar-09 5:41 
GeneralRe: recieving error in this program Pin
Luc Pattyn12-Mar-09 6:12
sitebuilderLuc Pattyn12-Mar-09 6:12 
GeneralRe: recieving error in this program Pin
fred_12-Mar-09 8:03
fred_12-Mar-09 8:03 
Questionconnecting to the Deleted Objects container in AD Pin
lane0p212-Mar-09 4:43
lane0p212-Mar-09 4:43 
Questiondatabase in sql server 2000 using c# Pin
mariamkhaqan12-Mar-09 4:37
mariamkhaqan12-Mar-09 4:37 
AnswerRe: database in sql server 2000 using c# Pin
Teuz12-Mar-09 5:05
Teuz12-Mar-09 5:05 

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.