Zachafer
04-07-2012, 03:09 PM
VBNet:
Option Strict On
Imports System.Net
Imports System.Text.RegularExpressions
Public Class HotmailFunctions
[Only registered and activated users can see links]
Public Shared Function HotmailExists(ByVal Email As String) As Boolean
If Not HotmailFunctions.IsValid(Email) Then
Return False
End If
Dim request As [Only registered and activated users can see links] =
DirectCast(WebRequest.Create("[Only registered and activated users can see links]"), [Only registered and activated users can see links])
request.Headers.Add("Cookie: MSPMemberExists=" & Email)
Dim response As [Only registered and activated users can see links] = DirectCast(request.GetResponse(), [Only registered and activated users can see links])
If response IsNot Nothing Then response.Close()
Return response.GetResponseHeader("Set-Cookie").ToLower().Contains("mspmemberexists=memberexists")
End Function
Public Shared Function IsValid(ByVal Email As String) As Boolean
Return HotmailFunctions.EmailPattern.IsMatch(Email)
End Function
End Class
C#:
using System.Net;
using System.Text.RegularExpressions;
class HotmailFunctions
{
[Only registered and activated users can see links]
public static bool HotmailExists(string email)
{
if (!HotmailFunctions.IsValid(email))
return false;
[Only registered and activated users can see links] request =
([Only registered and activated users can see links])WebRequest.Create("[Only registered and activated users can see links]");
request.Headers.Add("Cookie: MSPMemberExists=" + email);
[Only registered and activated users can see links] response = ([Only registered and activated users can see links])request.GetResponse();
if (response != null)
response.Close();
return response.GetResponseHeader("Set-Cookie")
.ToLower().Contains("mspmemberexists=memberexists");
}
public static bool IsValid(string email)
{
return HotmailFunctions.EmailPattern.IsMatch(email);
}
}
Option Strict On
Imports System.Net
Imports System.Text.RegularExpressions
Public Class HotmailFunctions
[Only registered and activated users can see links]
Public Shared Function HotmailExists(ByVal Email As String) As Boolean
If Not HotmailFunctions.IsValid(Email) Then
Return False
End If
Dim request As [Only registered and activated users can see links] =
DirectCast(WebRequest.Create("[Only registered and activated users can see links]"), [Only registered and activated users can see links])
request.Headers.Add("Cookie: MSPMemberExists=" & Email)
Dim response As [Only registered and activated users can see links] = DirectCast(request.GetResponse(), [Only registered and activated users can see links])
If response IsNot Nothing Then response.Close()
Return response.GetResponseHeader("Set-Cookie").ToLower().Contains("mspmemberexists=memberexists")
End Function
Public Shared Function IsValid(ByVal Email As String) As Boolean
Return HotmailFunctions.EmailPattern.IsMatch(Email)
End Function
End Class
C#:
using System.Net;
using System.Text.RegularExpressions;
class HotmailFunctions
{
[Only registered and activated users can see links]
public static bool HotmailExists(string email)
{
if (!HotmailFunctions.IsValid(email))
return false;
[Only registered and activated users can see links] request =
([Only registered and activated users can see links])WebRequest.Create("[Only registered and activated users can see links]");
request.Headers.Add("Cookie: MSPMemberExists=" + email);
[Only registered and activated users can see links] response = ([Only registered and activated users can see links])request.GetResponse();
if (response != null)
response.Close();
return response.GetResponseHeader("Set-Cookie")
.ToLower().Contains("mspmemberexists=memberexists");
}
public static bool IsValid(string email)
{
return HotmailFunctions.EmailPattern.IsMatch(email);
}
}