开发者

How to get userid by email?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜