惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - Hyke

借助Elecard MPEG2 Decoder的Easy RealMedia Tools可以成功转MPEG为RMVB 自己总结的如何用C#查找webBrowser页面中input的checkbox的checked属性! - Hyke - 博客园 C#中将字符串转成 Base64 编码 C#-对称加密的一个例子 SharpDevelop的如何支持中文? 求助:有没有PDF分析并显示的相关类啊? 求助:有什么控件可以显示PDF文件啊? [我的重大收获]C#WinForm实现URI对汉字进行编码! [总结]如何让文本框自动显示最新加入的内容呢?(C#) - Hyke - 博客园 [原创]C#.NET网络编程POST数据到网站 [原创]小测:是易语言快,还是.NET快啊? [原创]自做小软件初步测试Access与SQLite数据库执行效率(C#) [推荐软件]QQ自动登录器1.6.1版正式发布! [转]如何高效使用SQLite .net (C#) [转]使用SQLite进行网站搜索 C# 创建新的SQlite数据库Database(两个方法) [转]SQLite数据库与其它一些数据库的性能比较 [转]在ppt中插入RealPlayer文件 Subtitle Workshop使用教程
今天初步摸索了一下如何创建新的XML文件
Hyke · 2007-08-12 · via 博客园 - Hyke

今天初步摸索了一下如何创建新的XML文件。系统环境,.net框架的2.0。

        public static void CreateAppConfigFile()
        
{
            
//创建XmlDocument实例
            XmlDocument doc1 = new XmlDocument();
            
//加入XML的声明段落
            XmlDeclaration declaration1 = doc1.CreateXmlDeclaration("1.0","gb2312","yes");
            doc1.AppendChild(declaration1);
            
//加入一个根元素
            XmlElement element1 = doc1.CreateElement("Config");            
            doc1.AppendChild(element1);
            
//加入第二级节点
            XmlElement element2 = doc1.CreateElement("UserInfo");
            element1.AppendChild(element2);
            
//在第二级节点下添加元素
            XmlElement element3 = doc1.CreateElement("NotEmpty");
            element3.InnerText 
= "false";
            element2.AppendChild(element3);

            element3 
= doc1.CreateElement("UserName");
            element2.AppendChild(element3);

            element3 
= doc1.CreateElement("UserPsd");
            element2.AppendChild(element3);

            doc1.Save(Form1.AppConfigFileName);
        }

posted on 2007-08-12 21:08  Hyke  阅读(482)  评论(0)    收藏  举报

刷新页面返回顶部