问题描述
朋友您好,
一个简单的问题。
我需要在xml配置文件中进行以下修改。
需要更换以下内容:
< security mode =TransportCredentialOnly>< transport clientCredentialType =Windows/>
with
< security mode =Transport>
< transport clientCredentialType =WindowsproxyCredentialType =无realm =/>
< message clientCredentialType =UserNamealgorithmSuite =Default/>
如何做到这一点。请帮忙。
我尝试了什么:
我试过google搜索并做了这样的事情......
XmlAttribute formId =(XmlAttribute)xmlDoc.SelectSingleNode(//安全[@模式= 'TransportCredentialOnly'];
如果(formId != null)
{
formId.Value =Transport; //设置为新值。
}
xmlDoc.Save(C:\\ temp \\web.config);
但是没有弄清楚如何添加以下属性:proxyCredentialType,clientCredentialType,algorithmSuite
Hello friends,
One quick question.
I need to do the following modification in a xml config file.
Need to replace the following:
<security mode="TransportCredentialOnly"><transport clientCredentialType="Windows"/>
with
<security mode="Transport">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
How to do this. Please help.
What I have tried:
I tried googling and done something like this...
XmlAttribute formId = (XmlAttribute)xmlDoc.SelectSingleNode("//security[@mode='TransportCredentialOnly'];
if (formId != null)
{
formId.Value = "Transport"; // Set to new value.
}
xmlDoc.Save("C:\\temp\\web.config");
But not getting a clue how to add the following attributes: proxyCredentialType, clientCredentialType, algorithmSuite
这篇关于C#如何在XML配置文件中添加新属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!