All pastes #491541 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-16 18:43 UTC
rendered paste body
public static void SetProperty(DirectoryEntry oDE, string PropertyName, string PropertyValue)
		{
			//check if the value is valid, otherwise dont update
			if(PropertyValue !=string.Empty)
			{
				//check if the property exists before adding it to the list
				if(oDE.Properties.Contains(PropertyName))
				{
					oDE.Properties[PropertyName][0]=PropertyValue; 
				}
				else
				{
					oDE.Properties[PropertyName].Add(PropertyValue);
				}
			}
		}