Results 1 to 4 of 4

Thread: Help With Pop3

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    8

    Unhappy Help With Pop3

    Can any of you c# gurus please convert this to vb.net please ?
    Code:
    		Send("stat");
    		string returned = GetPop3String();
    		// if values returned ...
    		if( Regex.Match(returned,
    			@"^.*\+OK[ |	]+([0-9]+)[ |	]+.*$").Success )
    		{
    				// get number of emails ...
    				count = long.Parse( Regex
    				.Replace(returned.Replace("\r\n","")
    				, @"^.*\+OK[ |	]+([0-9]+)[ |	]+.*$" ,"$1") );
    		}
    
    		return(count);

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Help With Pop3

    Thread moved from CodeBank forum (which is for code examples, not questions)

  3. #3
    Registered User nmadd's Avatar
    Join Date
    Jun 2007
    Location
    U.S.A.
    Posts
    1,676

    Re: Help With Pop3


  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    8

    Re: Help With Pop3

    Thanks for the tip. Code was converted as below, BUT it does not return the count as the C# code does !!!
    http://labs.developerfusion.co.uk/co...arp-to-vb.aspx

    Send("stat")
    Dim returned As String = GetPop3String()

    ( returned =
    +OK POP3 server ready (7.3.110.11) <[email protected]> )

    ' if values returned ...
    If Regex.Match(returned, "^.*\+OK[ |" & Chr(9) & "]+([0-9]+)[ |" & Chr(9) & "]+.*$").Success Then
    ' get number of emails ...
    count = Long.Parse(Regex.Replace(returned.Replace("" & Chr(13) & "" & Chr(10) & "", ""), "^.*\+OK[ |" & Chr(9) & "]+([0-9]+)[ |" & Chr(9) & "]+.*$", "$1"))
    End If
    Return (count)
    Last edited by gobajo; Aug 24th, 2007 at 11:11 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width