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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Last Watchdog
The Last Watchdog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
C
Check Point Blog
T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
V
Vulnerabilities – Threatpost
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
S
Security @ Cisco Blogs
IT之家
IT之家
T
The Exploit Database - CXSecurity.com
The GitHub Blog
The GitHub Blog
D
Docker
Engineering at Meta
Engineering at Meta
AWS News Blog
AWS News Blog
S
Security Affairs
U
Unit 42
P
Palo Alto Networks Blog
V
Visual Studio Blog
Y
Y Combinator Blog
D
DataBreaches.Net
Forbes - Security
Forbes - Security
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
Security Latest
Security Latest
aimingoo的专栏
aimingoo的专栏
Simon Willison's Weblog
Simon Willison's Weblog
A
Arctic Wolf
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
博客园 - 司徒正美
博客园 - Franky
宝玉的分享
宝玉的分享
TaoSecurity Blog
TaoSecurity Blog
Latest news
Latest news
Scott Helme
Scott Helme
MongoDB | Blog
MongoDB | Blog
量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
Cisco Blogs
P
Privacy International News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - kenly33

ORM及代码生成器和插件C#源码(最新版Kenly.DBFramework4.5.8.5) 處理RadioButtonList客戶端事件 - kenly33 - 博客园 对象关系映射架构(DBFramework)及代码生成器和插件(源码) 使對象支持自定義比較 統計分數 Visual Studio Team System简介 过滤某些字段重复的记录 MultiFileUploador GridViewNavigator Gridview梆定 兩個輸入框只允許一個輸入 Gridview中梆定得RadioButton Javascript 隱藏或顯示某區域 ASP.NET 2.0中合并 GridView 的表头单元格 VS2005 RESOURCE MANAGEMENT 鲸鱼哲学 Javascript彈出對話框 FxCop Rules Atlas使用演练
讀寫XML文檔 - kenly33 - 博客园
kenly33 · 2007-06-18 · via 博客园 - kenly33

XML 

<?xml version="1.0" encoding="utf-8" ?>
<Project>
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{FE735FF0-83C1-409A-8D20-2FAD109B1ECA}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>FIH.GSQM.Learning.Business</RootNamespace>
    <AssemblyName>FIH.GSQM.Learning.Business</AssemblyName>
    <SccProjectName>
    </SccProjectName>
    <SccLocalPath>
    </SccLocalPath>
    <SccAuxPath>
    </SccAuxPath>
    <SccProvider>
    </SccProvider>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Kenly.DBFramework, Version=3.2.1.0, Culture=neutral, PublicKeyToken=579f5f2ea05ed1ec, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>Components\Kenly.DBFramework.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

        private void GenerateProjectFile(DataSet ds, string path)
        {
            string templateFileName = Application.StartupPath + "\\Template\\Project.csproj";
            if (!File.Exists(templateFileName))
            {
                return;
            }
            string newFileName = path + "\\" + txtNameSpace.Text + ".csproj";

            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(templateFileName);
            XPathNavigator navigator = xmlDoc.CreateNavigator();

            XPathNavigator node = navigator.SelectSingleNode("//ProjectGuid");
            node.InnerXml = System.Guid.NewGuid().ToString();

            node = navigator.SelectSingleNode("//RootNamespace");
            node.InnerXml = txtNameSpace.Text;

            node = navigator.SelectSingleNode("//AssemblyName");
            node.InnerXml = txtNameSpace.Text;

            node = navigator.SelectSingleNode("//Project");
            node.AppendChild("<ItemGroup>"+GetCSNodeText(ds)+"</ItemGroup>");
            node.AppendChild("<ItemGroup><Compile Include=\"Utility\\SystemConfig.cs\"/></ItemGroup>");

            node = navigator.SelectSingleNode("//Project");
            node.CreateAttribute("", "xmlns", "", "http://schemas.microsoft.com/developer/msbuild/2003");

            xmlDoc.Save(newFileName);
        }

        private string GetCSNodeText(DataSet ds)
        {
            StringBuilder nodeText = new StringBuilder();

            foreach (DataTable table in ds.Tables)
            {
                nodeText.Append("<Compile Include=\""+table.TableName+".cs\" />");
            }
            return nodeText.ToString();
        }