static void Main(string[] args)
{
using (SPSite mySite = new SPSite("sitename"))
{
using (SPWeb myWeb = mySite.OpenWeb())
{
string userEmail = "foo@example.com"开发者_StackOverflow社区;
string userName = Membership.GetUserNameByEmail(userEmail);
Console.WriteLine("Your UserName is: " + userName);
}
}
}
This code is retuning NULL. What am i doing wrong in this code?
Obviously the simplest answer is that no user was found with that e-mail. If you believe that is not the case, please show why and I will try to help you out.
精彩评论