|
-
Aug 23rd, 2007, 01:48 PM
#1
Thread Starter
New Member
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);
-
Aug 23rd, 2007, 02:19 PM
#2
Re: Help With Pop3
Thread moved from CodeBank forum (which is for code examples, not questions)
-
Aug 23rd, 2007, 04:48 PM
#3
-
Aug 24th, 2007, 10:40 AM
#4
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|