bin/debuge下面
1.文件夹移动:log复制到Log2
System.IO.Directory.Move("Log","Log2");
if (!Directory.Exists("Log"))
{
Directory.CreateDirectory("Log");
}
DateTime now = DateTime.Now;
string logFileName = now.ToString("yyyyMMdd") + ".txt";
string fullName = "Log\\" + logFileName;
if (!File.Exists(fullName))
{
File.Create(fullName);
}
4.打开wod文件
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.FileName = @"D:\我的XXX.docx";
// proc.StartInfo.Arguments = @"D:\我的XXX.docx";
proc.Start();
5.获取路径路径到BIN
System.AppDomain.CurrentDomain.BaseDirectory;
6.CDATA 怎么产生这样的数据?
<XXZY1><![CDATA[郑亚敏1]]></XXZY1>
XmlNode objNode = xmlDocument.DocumentElement.SelectSingleNode("//CommitUnitName");
XmlCDataSection CData = xmlDocument.CreateCDataSection("<郑亚敏");
objNode.InnerXml = "";//清空节点里面的数据
(objNode as XmlElement).AppendChild(CData);
7.修改一个节点的Name值
XmlNode xn = xmlDocument.DocumentElement.SelectSingleNode("//CommitUnitName");
XmlHelper.AppendAttr(xn,"Name","郑亚敏");
<XmlTextTag>
<CommitUnitName Name="郑亚敏11111">
</CommitUnitName>
</XmlTextTag>