本文整理匯總了C#中System.Xml.XmlDataDocument.CreateTextNode方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlDataDocument.CreateTextNode方法的具體用法?C# XmlDataDocument.CreateTextNode怎麽用?C# XmlDataDocument.CreateTextNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XmlDataDocument
的用法示例。
在下文中一共展示了XmlDataDocument.CreateTextNode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddLink
public void AddLink(string title, string uri)
{
XmlDocument doc = new XmlDataDocument();
doc.Load("RssLinks.xml");
XmlNode rootNode = doc.SelectSingleNode("links");
XmlNode linkNode = doc.CreateElement("link");
XmlNode titleNode = doc.CreateElement("title");
XmlText titleText = doc.CreateTextNode(title);
titleNode.AppendChild(titleText);
XmlNode uriNode = doc.CreateElement("uri");
XmlText uriText = doc.CreateTextNode(uri);
uriNode.AppendChild(uriText);
XmlNode defaultshowNode = doc.CreateElement("defaultshow");
XmlText defaultshowText = doc.CreateTextNode("false");
defaultshowNode.AppendChild(defaultshowText);
linkNode.AppendChild(titleNode);
linkNode.AppendChild(uriNode);
linkNode.AppendChild(defaultshowNode);
rootNode.AppendChild(linkNode);
doc.Save("RssLinks.xml");
}
示例2: DataCollection
public XmlDataDocument DataCollection(string mac, string ip, string hostname, string UserName,string Domain)
{
string result = "";
if (string.IsNullOrEmpty(mac) && string.IsNullOrEmpty(ip) && string.IsNullOrEmpty(hostname) && string.IsNullOrEmpty(UserName) && string.IsNullOrEmpty(Domain))
{
result = "-2";
}
else
{
SqlStatment.InsertData(mac, ip, hostname, UserName,Domain);
result = "0";
}
XmlDataDocument xd = new XmlDataDocument();
//XmlStr.Append("<?xml version=\"1.0\" encoding=\"gb2312\"?>");
XmlDeclaration newDec = xd.CreateXmlDeclaration("1.0", "gb2312", null);
xd.AppendChild(newDec);
XmlElement xmlElemFileName = xd.CreateElement("result");
XmlText xmlTextFileName = xd.CreateTextNode(result);
xmlElemFileName.AppendChild(xmlTextFileName);
xd.AppendChild(xmlElemFileName);
return xd;
}
示例3: CheckClient
public XmlDataDocument CheckClient(string mac, string ip, string hostname,string UserName,string Domain)
{
string result = "";
if (string.IsNullOrEmpty(mac) && string.IsNullOrEmpty(ip) && string.IsNullOrEmpty(hostname) && string.IsNullOrEmpty(Domain))
{
result = "-2";
}
else
{
DataTable dt = SqlStatment.CheckLogin(hostname, mac, Domain);
result = dt.Rows[0][0].ToString();
}
XmlDataDocument xd = new XmlDataDocument();
//XmlStr.Append("<?xml version=\"1.0\" encoding=\"gb2312\"?>");
XmlDeclaration newDec = xd.CreateXmlDeclaration("1.0", "gb2312", null);
xd.AppendChild(newDec);
XmlElement xmlElemFileName = xd.CreateElement("result");
XmlText xmlTextFileName = xd.CreateTextNode(result);
xmlElemFileName.AppendChild(xmlTextFileName);
xd.AppendChild(xmlElemFileName);
return xd;
}