Click here to Skip to main content
15,895,606 members
Home / Discussions / C#
   

C#

 
Questionhow to delete mail from mail server using C# Pin
khosnur1-Sep-09 19:25
khosnur1-Sep-09 19:25 
AnswerRe: how to delete mail from mail server using C# Pin
ThatsAlok1-Sep-09 19:50
ThatsAlok1-Sep-09 19:50 
GeneralRe: how to delete mail from mail server using C# Pin
khosnur1-Sep-09 20:38
khosnur1-Sep-09 20:38 
AnswerRe: how to delete mail from mail server using C# Pin
Tamer Oz1-Sep-09 19:55
Tamer Oz1-Sep-09 19:55 
GeneralRe: how to delete mail from mail server using C# Pin
khosnur1-Sep-09 20:43
khosnur1-Sep-09 20:43 
GeneralRe: how to delete mail from mail server using C# Pin
Tamer Oz1-Sep-09 20:58
Tamer Oz1-Sep-09 20:58 
GeneralRe: how to delete mail from mail server using C# Pin
khosnur1-Sep-09 21:21
khosnur1-Sep-09 21:21 
GeneralRe: how to delete mail from mail server using C# Pin
Tamer Oz1-Sep-09 21:44
Tamer Oz1-Sep-09 21:44 
Could you try

private string GetResponse()
{

    //read till finding new line, return.

    string strPrev = null;

    string strCurrent = null;

    string strMessage = null;

    NetworkStream ns = default(NetworkStream);

    ns = client.GetStream;//Previously instanced and connected TcpClient

    while (true)
    {

        byte[] buffer = new byte[1];
        //read by 1 byte 1 byte

        ns.Read(buffer, 0, buffer.Length);

        strCurrent = System.Text.Encoding.GetEncoding(1254).GetString(buffer);

        strMessage = strMessage + strCurrent;

        if (strCurrent == @"\r" && strPrev == @"\n")
        {

            break; // TODO: might not be correct. Was : Exit While
        }


        strPrev = strCurrent;
    }


    return strMessage;
}

private void SendMessage(string str)
{

    str = str + "\r\n";
    //Controlchars.CrLf '10+13

    byte[] buffer = System.Text.Encoding.GetEncoding(1254).GetBytes(str);

    NetworkStream ns = client.GetStream;


    ns.Write(buffer, 0, buffer.Length);
}

GeneralRe: how to delete mail from mail server using C# Pin
khosnur1-Sep-09 20:46
khosnur1-Sep-09 20:46 
QuestionOnPaint Event Pin
Reza Shojaee1-Sep-09 19:03
Reza Shojaee1-Sep-09 19:03 
AnswerRe: OnPaint Event Pin
Christian Graus1-Sep-09 20:56
protectorChristian Graus1-Sep-09 20:56 
Questionconnections Pin
ihe1-Sep-09 18:56
ihe1-Sep-09 18:56 
AnswerRe: connections Pin
Christian Graus1-Sep-09 20:59
protectorChristian Graus1-Sep-09 20:59 
AnswerRe: connections Pin
Ashfield1-Sep-09 21:00
Ashfield1-Sep-09 21:00 
GeneralRe: connections Pin
ihe4-Sep-09 13:21
ihe4-Sep-09 13:21 
GeneralRe: connections Pin
Ashfield5-Sep-09 2:28
Ashfield5-Sep-09 2:28 
QuestionGroup Selection in List View Pin
vhassan1-Sep-09 18:46
vhassan1-Sep-09 18:46 
QuestionConvert xml file to word document Pin
Swetha Srinivasan1-Sep-09 18:46
Swetha Srinivasan1-Sep-09 18:46 
AnswerRe: Convert xml file to word document Pin
Tamer Oz1-Sep-09 19:59
Tamer Oz1-Sep-09 19:59 
GeneralRe: Convert xml file to word document Pin
Swetha Srinivasan1-Sep-09 20:15
Swetha Srinivasan1-Sep-09 20:15 
GeneralRe: Convert xml file to word document Pin
Tamer Oz1-Sep-09 20:27
Tamer Oz1-Sep-09 20:27 
QuestionHere is a stumper.... Pin
JollyMansArt1-Sep-09 17:58
JollyMansArt1-Sep-09 17:58 
AnswerRe: Here is a stumper.... Pin
Christian Graus1-Sep-09 18:20
protectorChristian Graus1-Sep-09 18:20 
AnswerRe: Here is a stumper.... Pin
cjb1101-Sep-09 21:55
cjb1101-Sep-09 21:55 
AnswerRe: Here is a stumper.... Pin
JollyMansArt2-Sep-09 3:51
JollyMansArt2-Sep-09 3:51 

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.