Click here to Skip to main content
15,899,937 members
Home / Discussions / C#
   

C#

 
GeneralRe: Component question. Pin
DaveyM6921-May-09 11:46
professionalDaveyM6921-May-09 11:46 
QuestionColoring pictures Pin
Sokka9321-May-09 6:56
Sokka9321-May-09 6:56 
AnswerRe: Coloring pictures Pin
Henry Minute21-May-09 7:15
Henry Minute21-May-09 7:15 
AnswerRe: Coloring pictures Pin
Dave Kreskowiak21-May-09 7:58
mveDave Kreskowiak21-May-09 7:58 
AnswerRe: Coloring pictures Pin
Luc Pattyn21-May-09 8:28
sitebuilderLuc Pattyn21-May-09 8:28 
AnswerRe: Coloring pictures Pin
Henry Minute21-May-09 8:36
Henry Minute21-May-09 8:36 
GeneralRe: Coloring pictures Pin
Sokka9321-May-09 9:03
Sokka9321-May-09 9:03 
QuestionPop3, Smtp, etc.. Pin
Quake2Player21-May-09 6:36
Quake2Player21-May-09 6:36 
Hi,

Pop3 and Smtp work the sameway.. one sends a string message to the server (eg: HELO, USER user, PASS pass) and the server responses (eg. 250 Hello and welcome)

Is there any standard class for this type of communication? something simple like
+Connect()
+Write(s)
+LastResponse()

Because i'm not getting good results ..though i'm trying to communicate with gmail's pop and smtp, so maybe i'm failing with the SSL thing..

I'm having trouble with the Writing and Response,

public string SendMessage(string message)
{
ASCIIEncoding asciiEncoder = new ASCIIEncoding();

byte[] WriteBuffer = new byte[1024]; // 1 KB
WriteBuffer = asciiEncoder.GetBytes(message);

NetworkStream stream = cl.GetStream(); // cl is a TcpClient

stream.Write(WriteBuffer, 0, WriteBuffer.Length);

// Get response after message
return Response();
}

And my response method is:

public string Response()

{

byte[] serverbuffer = new Byte[1024]; //1 KB

int count = ns.Read(serverbuffer, 0, 1024);
if (count == 0)
{
return "";
}

return Encoding.ASCII.GetString(serverbuffer, 0, count);


}
QuestionBreak Point Pin
kibromg21-May-09 6:08
kibromg21-May-09 6:08 
AnswerRe: Break Point Pin
Henry Minute21-May-09 6:21
Henry Minute21-May-09 6:21 
GeneralRe: Break Point Pin
kibromg21-May-09 6:28
kibromg21-May-09 6:28 
GeneralRe: Break Point Pin
Henry Minute21-May-09 6:44
Henry Minute21-May-09 6:44 
GeneralRe: Break Point Pin
kibromg21-May-09 6:48
kibromg21-May-09 6:48 
GeneralRe: Break Point Pin
OriginalGriff21-May-09 8:28
mveOriginalGriff21-May-09 8:28 
Questionhow to call 1 class method or constructor in other class ? Pin
xingselex21-May-09 6:06
xingselex21-May-09 6:06 
AnswerRe: how to call 1 class method or constructor in other class ? Pin
musefan21-May-09 6:12
musefan21-May-09 6:12 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
xingselex21-May-09 6:20
xingselex21-May-09 6:20 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
Henry Minute21-May-09 6:26
Henry Minute21-May-09 6:26 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
xingselex21-May-09 6:37
xingselex21-May-09 6:37 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
Henry Minute21-May-09 6:42
Henry Minute21-May-09 6:42 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
xingselex21-May-09 6:45
xingselex21-May-09 6:45 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
xingselex21-May-09 7:05
xingselex21-May-09 7:05 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
harold aptroot21-May-09 7:07
harold aptroot21-May-09 7:07 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
xingselex21-May-09 7:11
xingselex21-May-09 7:11 
GeneralRe: how to call 1 class method or constructor in other class ? Pin
OriginalGriff21-May-09 8:31
mveOriginalGriff21-May-09 8:31 

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.