从xml文件中读取注释

void Main() {     string dirp=@"E:\Cread\UP4201308.bak\UP4.BAK\ExportPath\ConfigFile\";   DirectoryInfo mydir = new DirectoryInfo(dirp);       foreach (FileSystemInfo fsi in mydir.GetFileSystemInfos())       {     if(fsi.Extension.ToLower()==".xml")     {    ("--"+ fsi.FullName).Dump();    try   {     Write(fsi.FullName);   }   catch(Exception ex)   {}     }         } //string pFileName = @"E:\Cread\UP4201308.bak\UP4.BAK\ExportPath\ConfigFile\AbsentDays.xml"; //Write(pFileName);     }    void Write(string pFileName)  {  string content=System.IO.File.ReadAllText(pFileName);  XElement config = XElement.Parse (content);     string tableName =config.Element ("TableName").Value;   string columnName ="";   string description ="";    ("--"+tableName).Dump();  XElement client = config.Element ("Columns");    string sqltemp="EXECUTE sp_addextendedproperty N'MS_Description', N'{2}', N'user', N'dbo', N'table', N'{0}', N'column', N'{1}'";  for(int i = 0;i<client.Elements("Column").Count();i++)  {  columnName = client.Elements("Column").ElementAt(i).Attribute("Name").Value.ToString();  description = client.Elements("Column").ElementAt(i).Attribute("Description").Value.ToString();  string sql=string.Format(sqltemp,tableName,columnName,description).Dump();  }  }

// Define other methods and classes here

上一篇:Java中将一个字符串传入数组的几种方法


下一篇:Linux(CentOS、Ububtu)一键安装Openstack及其它参考文档汇总