SetAttribute

Element.SetAttribute method

添加一个新属性。如果元素中已存在具有该名称的属性,则其值将更改为值 parameter 的值

public void SetAttribute(string name, string value)
范围类型描述
nameString属性名称。
valueString价值。

也可以看看