using System;using System.Xml;/// ///Unitity 的摘要说明/// public class Unitity{ /// /// 1.1,获取当前日期和时间 /// 格式为:hhmmss /// /// public static string GetCurrentDateTime() { DateTime date = DateTime.Now; return date.ToString("HHmmss"); } /// /// 1.2,获取当前日期和时间 /// 格式为:yyyyMMddhhmmssSSS /// /// public static string GetCurrentDateTimeToMillisecond() { DateTime date = DateTime.Now; return date.ToString("HHmmss")+date.Millisecond; } /// /// 1.3,获取当前日期和时间 /// 格式为:yyyyMMddhhmmssSSS /// /// public static string GetFullCurrentDateTime() { DateTime date = DateTime.Now; return date.ToString("yyyyMMddhhmmss") + date.Millisecond; } /// /// 1.4,获取当前日期 /// 格式为:yyyyMMdd /// /// public static string GetCurrentDate() { DateTime date = DateTime.Now; return date.ToString("yyyyMMdd"); } /// /// 数字字符串:长度10位,代表明文数据长度,不足10位左补0 /// /// /// public static string ConvertInt32(int i) { return string.Format("{0:D10}", i); } /// /// 明文:xml明文,长度可变,需要上面的数据指明,双字节字符(汉字)算作1位长度 /// /// /// public static int SignLength(string str) { return str.Length; } /// /// 分隔符:ICBCCMP /// public static string FenGeFu = "ICBCCMP"; // public Unitity() { // //TODO: 在此处添加构造函数逻辑 // } public static XmlNode GetXMLNode(string strXML, string Path) { XmlDocument xdoc = new XmlDocument();//结果hash xdoc.LoadXml(strXML); XmlNode Node = xdoc.SelectSingleNode(Path); return Node; }}