Click here to Skip to main content
15,891,828 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to get Country List with Two-letter country codes? Pin
Gonzoox24-Feb-10 3:56
Gonzoox24-Feb-10 3:56 
GeneralRe: How to get Country List with Two-letter country codes? Pin
Cyber Friend24-Feb-10 4:17
Cyber Friend24-Feb-10 4:17 
GeneralRe: How to get Country List with Two-letter country codes? Pin
Gonzoox24-Feb-10 4:23
Gonzoox24-Feb-10 4:23 
GeneralRe: How to get Country List with Two-letter country codes? Pin
Cyber Friend24-Feb-10 5:00
Cyber Friend24-Feb-10 5:00 
GeneralRe: How to get Country List with Two-letter country codes? Pin
Richard MacCutchan24-Feb-10 3:19
mveRichard MacCutchan24-Feb-10 3:19 
AnswerRe: How to get Country List with Two-letter country codes? Pin
Gonzoox24-Feb-10 3:45
Gonzoox24-Feb-10 3:45 
AnswerRe: How to get Country List with Two-letter country codes? Pin
Bernhard Hiller26-Feb-10 0:04
Bernhard Hiller26-Feb-10 0:04 
Questionsocket Pin
aurelcly23-Feb-10 22:35
aurelcly23-Feb-10 22:35 
I have a small problem to send a collection or array via socket as we know we can only send byte.
This is a small example of what I wanna do but it is not work:

List<string> list = new List<string>();
list.Add("item1");
list.Add("item1");
sockt.Send(list);


I try this small piece of code but I do not received what I need
//////// Client Application

String username = Console.ReadLine();
String password =  Console.ReadLine();

byte[] msg1 = Encoding.ASCII.GetBytes(username);
byte[] msg2 = Encoding.ASCII.GetBytes(password);

// Build the buffers for the send.
List<ArraySegment<byte>> sendBuffers = new List<ArraySegment<byte>>(2);
                                    
sendBuffers.Add(new ArraySegment<byte>(msg1));
                                    
sendBuffers.Add(new ArraySegment<byte>(msg2));

client.Send(sendBuffers);

//////// Server Application

// Build the buffers for the receive.
List<ArraySegment<byte>> recvBuffers = new List<ArraySegment<byte>>(2);
                                     
byte[] username = new byte[10];
byte[] password = new byte[10];

// Specify the first buffer
recvBuffers.Add(new ArraySegment<byte>(username));
                                    
// Specify the second buffer
recvBuffers.Add(new ArraySegment<byte>(password));
                                    
try
{  
    int bytesReceived = sock.Receive(recvBuffers);
}
catch
{
}

sockt.Received(recvBuffers);


Now if in Client enter
toto as username and 123456 as password
in server I received toto123456 no totoand 123456 seperatly
What can I proceed.
AnswerRe: socket Pin
Richard MacCutchan24-Feb-10 1:24
mveRichard MacCutchan24-Feb-10 1:24 
AnswerRe: socket Pin
PIEBALDconsult24-Feb-10 9:27
mvePIEBALDconsult24-Feb-10 9:27 
QuestionDeleting an occurance of a string Pin
muka6623-Feb-10 22:20
muka6623-Feb-10 22:20 
AnswerRe: Deleting an occurance of a string Pin
OriginalGriff23-Feb-10 22:39
mveOriginalGriff23-Feb-10 22:39 
GeneralRe: Deleting an occurance of a string Pin
muka6624-Feb-10 1:28
muka6624-Feb-10 1:28 
GeneralRe: Deleting an occurance of a string Pin
OriginalGriff24-Feb-10 4:35
mveOriginalGriff24-Feb-10 4:35 
GeneralRe: Deleting an occurance of a string Pin
OriginalGriff24-Feb-10 4:37
mveOriginalGriff24-Feb-10 4:37 
AnswerRe: Deleting an occurance of a string Pin
Ravi Bhavnani24-Feb-10 7:44
professionalRavi Bhavnani24-Feb-10 7:44 
QuestionAcquireReaderLock Problems Pin
Sandy-Lee23-Feb-10 22:07
Sandy-Lee23-Feb-10 22:07 
AnswerRe: AcquireReaderLock Problems Pin
Richard MacCutchan24-Feb-10 1:29
mveRichard MacCutchan24-Feb-10 1:29 
Questionconnecting to telnet and executing perl script [modified] Pin
l.laxmikant23-Feb-10 21:49
l.laxmikant23-Feb-10 21:49 
AnswerRe: connecting to telnet and executing perl script Pin
Richard MacCutchan23-Feb-10 21:55
mveRichard MacCutchan23-Feb-10 21:55 
GeneralRe: connecting to telnet and executing perl script Pin
l.laxmikant23-Feb-10 22:00
l.laxmikant23-Feb-10 22:00 
GeneralRe: connecting to telnet and executing perl script Pin
Pete O'Hanlon23-Feb-10 22:28
mvePete O'Hanlon23-Feb-10 22:28 
GeneralRe: connecting to telnet and executing perl script Pin
l.laxmikant23-Feb-10 22:58
l.laxmikant23-Feb-10 22:58 
GeneralRe: connecting to telnet and executing perl script Pin
Pete O'Hanlon23-Feb-10 23:41
mvePete O'Hanlon23-Feb-10 23:41 
GeneralRe: connecting to telnet and executing perl script Pin
l.laxmikant24-Feb-10 0:22
l.laxmikant24-Feb-10 0:22 

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.