C# 如何从ActiveDirectory检索用户映像?

C# 如何从ActiveDirectory检索用户映像?,c#,asp.net,active-directory,C#,Asp.net,Active Directory,我有从Active Directory获取用户映像的解决方案,我的代码做得很好,但我无法将ImageURL添加到来自Active Directory的映像中 byte[] data = user.Properties["thumbnailPhoto"].Value as byte[]; if (data != null) { using (MemoryStream s = new MemoryStream(data, 0, data.Length)) { s.Posi

我有从Active Directory获取用户映像的解决方案,我的代码做得很好,但我无法将
ImageURL
添加到来自Active Directory的映像中

byte[] data = user.Properties["thumbnailPhoto"].Value as byte[];

if (data != null)
{
   using (MemoryStream s = new MemoryStream(data, 0, data.Length))
   {
       s.Position = 0;
       s.Write(data, 0, data.Length);

       //here I want to add the imageurl to Image controll
   }
}
副本