摘要:
View Code bool isModified = false; foreach (string key in ConfigurationManager.AppSettings) { if (key == "box") { isModified = true; } } Configuration config = ConfigurationManager.OpenExeConfiguration(Configu... 阅读全文
摘要:
View Code 1 #region 枚举公用转换类 2 public class EnumDescConverter : System.ComponentModel.EnumConverter 3 { 4 protected System.Type m_MyVal; 5 public static string GetEnumDescription(Enum value) 6 { 7 FieldInfo fi = value.GetType().GetField(value.ToString(... 阅读全文
摘要:
View Code 1 public ProjectInstaller() 2 { 3 InitializeComponent(); 4 this.Committed += new InstallEventHandler(ProjectInstaller_Committed); 5 } 6 7 private void ProjectInstaller_Committed(object sender, InstallEventArgs e) 8 { 9 ... 阅读全文
摘要:
View Code 1 XmlDocument doc = new XmlDocument(); 2 XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null); 3 doc.AppendChild(dec); 4 //创建一个根节点(一级) 5 XmlElement root = doc.CreateElement("First"); 6 doc.AppendChild(root); 7 ... 阅读全文