欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#實現(xiàn)利用Linq操作Xml文件

 更新時間:2022年12月29日 08:52:56   作者:芝麻粒兒  
這篇文章主要為大家詳細介紹了C#如何利用Linq實現(xiàn)操作Xml文件,文中的示例代碼講解詳細,對我們學習C#有一定的幫助,感興趣的小伙伴可以跟隨小編一起了解一下

實踐過程

效果

代碼

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    static string strPath = "Employee.xml";
    static string strID = "";

    //窗體加載時加載XML文件
    private void Form1_Load(object sender, EventArgs e)
    {
        if (File.Exists(strPath))
        {
            groupBox1.Enabled = false;
            getXmlInfo();
        }
        else
            groupBox1.Enabled = true;
    }

    //創(chuàng)建XML文件
    private void button1_Click(object sender, EventArgs e)
    {
        XDocument doc = new XDocument(
            new XDeclaration("1.0", "utf-8", "yes"),
            new XElement(textBox1.Text,
                new XElement(textBox2.Text, new XAttribute(textBox3.Text, textBox10.Text),
                    new XElement(textBox4.Text, textBox5.Text),
                    new XElement(textBox6.Text, textBox7.Text),
                    new XElement(textBox8.Text, textBox9.Text))
                )
            );
        doc.Save(strPath);
        groupBox1.Enabled = false;
        getXmlInfo();
    }

    //添加XML元素
    private void button2_Click(object sender, EventArgs e)
    {
        XElement xe = XElement.Load(strPath);
        IEnumerable<XElement> elements1 = from element in xe.Elements("People")
                                          select element;
        //生成新的編號
        string str = (Convert.ToInt32(elements1.Max(element => element.Attribute("ID").Value)) + 1).ToString("000");
        XElement people = new XElement(
            "People", new XAttribute("ID", str),
            new XElement("Name", textBox11.Text),
            new XElement("Sex", comboBox1.Text),
            new XElement("Salary", textBox12.Text)
            );
        xe.Add(people);
        xe.Save(strPath);
        getXmlInfo();
    }

    //修改XML元素
    private void button3_Click(object sender, EventArgs e)
    {
        if (strID != "")
        {
            XElement xe = XElement.Load(strPath);
            IEnumerable<XElement> elements = from element in xe.Elements("People")
                                             where element.Attribute("ID").Value == strID
                                             select element;
            if (elements.Count() > 0)
            {
                XElement newXE = elements.First();
                newXE.SetAttributeValue("ID", strID);
                newXE.ReplaceNodes(
                    new XElement("Name", textBox11.Text),
                    new XElement("Sex", comboBox1.Text),
                    new XElement("Salary", textBox12.Text)
                    );
            }
            xe.Save(strPath);
        } 
        getXmlInfo();
    }

    //刪除XML元素
    private void button4_Click(object sender, EventArgs e)
    {
        if (strID != "")
        {
            XElement xe = XElement.Load(strPath);
            IEnumerable<XElement> elements = from element in xe.Elements("People")
                                             where element.Attribute("ID").Value == strID
                                             select element;
            if (elements.Count() > 0)
                elements.First().Remove();
            xe.Save(strPath);
        }
        getXmlInfo();
    }

    //顯示選中XML節(jié)點的詳細信息
    private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        strID = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
        XElement xe = XElement.Load(strPath);
        IEnumerable<XElement> elements = from PInfo in xe.Elements("People")
                                         where PInfo.Attribute("ID").Value == strID
                                         select PInfo;
        foreach (XElement element in elements)
        {
            textBox11.Text = element.Element("Name").Value;
            comboBox1.SelectedItem = element.Element("Sex").Value;
            textBox12.Text = element.Element("Salary").Value;
        }
    }

    #region 將XML文件內(nèi)容綁定到DataGridView控件
    /// <summary>
    /// 將XML文件內(nèi)容綁定到DataGridView控件
    /// </summary>
    private void getXmlInfo()
    {
        DataSet myds = new DataSet();
        myds.ReadXml(strPath);
        dataGridView1.DataSource = myds.Tables[0];
    }
    #endregion
}
partial class Form1
{
    /// <summary>
    /// 必需的設(shè)計器變量。
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// 清理所有正在使用的資源。
    /// </summary>
    /// <param name="disposing">如果應(yīng)釋放托管資源,為 true;否則為 false。</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    #region Windows 窗體設(shè)計器生成的代碼

    /// <summary>
    /// 設(shè)計器支持所需的方法 - 不要
    /// 使用代碼編輯器修改此方法的內(nèi)容。
    /// </summary>
    private void InitializeComponent()
    {
        this.groupBox1 = new System.Windows.Forms.GroupBox();
        this.textBox10 = new System.Windows.Forms.TextBox();
        this.label10 = new System.Windows.Forms.Label();
        this.button1 = new System.Windows.Forms.Button();
        this.textBox9 = new System.Windows.Forms.TextBox();
        this.label8 = new System.Windows.Forms.Label();
        this.textBox8 = new System.Windows.Forms.TextBox();
        this.label9 = new System.Windows.Forms.Label();
        this.textBox7 = new System.Windows.Forms.TextBox();
        this.label2 = new System.Windows.Forms.Label();
        this.textBox6 = new System.Windows.Forms.TextBox();
        this.label7 = new System.Windows.Forms.Label();
        this.textBox5 = new System.Windows.Forms.TextBox();
        this.label5 = new System.Windows.Forms.Label();
        this.textBox4 = new System.Windows.Forms.TextBox();
        this.label6 = new System.Windows.Forms.Label();
        this.textBox3 = new System.Windows.Forms.TextBox();
        this.label3 = new System.Windows.Forms.Label();
        this.textBox2 = new System.Windows.Forms.TextBox();
        this.label4 = new System.Windows.Forms.Label();
        this.textBox1 = new System.Windows.Forms.TextBox();
        this.label1 = new System.Windows.Forms.Label();
        this.groupBox2 = new System.Windows.Forms.GroupBox();
        this.button4 = new System.Windows.Forms.Button();
        this.button3 = new System.Windows.Forms.Button();
        this.button2 = new System.Windows.Forms.Button();
        this.comboBox1 = new System.Windows.Forms.ComboBox();
        this.textBox12 = new System.Windows.Forms.TextBox();
        this.label12 = new System.Windows.Forms.Label();
        this.label13 = new System.Windows.Forms.Label();
        this.textBox11 = new System.Windows.Forms.TextBox();
        this.label14 = new System.Windows.Forms.Label();
        this.dataGridView1 = new System.Windows.Forms.DataGridView();
        this.groupBox1.SuspendLayout();
        this.groupBox2.SuspendLayout();
        ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
        this.SuspendLayout();
        // 
        // groupBox1
        // 
        this.groupBox1.Controls.Add(this.textBox10);
        this.groupBox1.Controls.Add(this.label10);
        this.groupBox1.Controls.Add(this.button1);
        this.groupBox1.Controls.Add(this.textBox9);
        this.groupBox1.Controls.Add(this.label8);
        this.groupBox1.Controls.Add(this.textBox8);
        this.groupBox1.Controls.Add(this.label9);
        this.groupBox1.Controls.Add(this.textBox7);
        this.groupBox1.Controls.Add(this.label2);
        this.groupBox1.Controls.Add(this.textBox6);
        this.groupBox1.Controls.Add(this.label7);
        this.groupBox1.Controls.Add(this.textBox5);
        this.groupBox1.Controls.Add(this.label5);
        this.groupBox1.Controls.Add(this.textBox4);
        this.groupBox1.Controls.Add(this.label6);
        this.groupBox1.Controls.Add(this.textBox3);
        this.groupBox1.Controls.Add(this.label3);
        this.groupBox1.Controls.Add(this.textBox2);
        this.groupBox1.Controls.Add(this.label4);
        this.groupBox1.Controls.Add(this.textBox1);
        this.groupBox1.Controls.Add(this.label1);
        this.groupBox1.Location = new System.Drawing.Point(6, 3);
        this.groupBox1.Name = "groupBox1";
        this.groupBox1.Size = new System.Drawing.Size(451, 190);
        this.groupBox1.TabIndex = 18;
        this.groupBox1.TabStop = false;
        this.groupBox1.Text = "創(chuàng)建XML文件";
        // 
        // textBox10
        // 
        this.textBox10.Location = new System.Drawing.Point(319, 47);
        this.textBox10.Name = "textBox10";
        this.textBox10.ReadOnly = true;
        this.textBox10.Size = new System.Drawing.Size(119, 21);
        this.textBox10.TabIndex = 3;
        this.textBox10.Text = "001";
        // 
        // label10
        // 
        this.label10.AutoSize = true;
        this.label10.Location = new System.Drawing.Point(236, 50);
        this.label10.Name = "label10";
        this.label10.Size = new System.Drawing.Size(89, 12);
        this.label10.TabIndex = 21;
        this.label10.Text = "子節(jié)點屬性值:";
        // 
        // button1
        // 
        this.button1.Location = new System.Drawing.Point(363, 158);
        this.button1.Name = "button1";
        this.button1.Size = new System.Drawing.Size(75, 23);
        this.button1.TabIndex = 10;
        this.button1.Text = "創(chuàng)建";
        this.button1.UseVisualStyleBackColor = true;
        this.button1.Click += new System.EventHandler(this.button1_Click);
        // 
        // textBox9
        // 
        this.textBox9.Location = new System.Drawing.Point(319, 131);
        this.textBox9.Name = "textBox9";
        this.textBox9.Size = new System.Drawing.Size(119, 21);
        this.textBox9.TabIndex = 9;
        // 
        // label8
        // 
        this.label8.AutoSize = true;
        this.label8.Location = new System.Drawing.Point(236, 134);
        this.label8.Name = "label8";
        this.label8.Size = new System.Drawing.Size(89, 12);
        this.label8.TabIndex = 18;
        this.label8.Text = "第三個元素值:";
        // 
        // textBox8
        // 
        this.textBox8.Location = new System.Drawing.Point(111, 131);
        this.textBox8.Name = "textBox8";
        this.textBox8.ReadOnly = true;
        this.textBox8.Size = new System.Drawing.Size(119, 21);
        this.textBox8.TabIndex = 8;
        this.textBox8.Text = "Salary";
        // 
        // label9
        // 
        this.label9.AutoSize = true;
        this.label9.Location = new System.Drawing.Point(12, 134);
        this.label9.Name = "label9";
        this.label9.Size = new System.Drawing.Size(101, 12);
        this.label9.TabIndex = 16;
        this.label9.Text = "第三個元素名稱:";
        // 
        // textBox7
        // 
        this.textBox7.Location = new System.Drawing.Point(319, 103);
        this.textBox7.Name = "textBox7";
        this.textBox7.Size = new System.Drawing.Size(119, 21);
        this.textBox7.TabIndex = 7;
        // 
        // label2
        // 
        this.label2.AutoSize = true;
        this.label2.Location = new System.Drawing.Point(236, 106);
        this.label2.Name = "label2";
        this.label2.Size = new System.Drawing.Size(89, 12);
        this.label2.TabIndex = 14;
        this.label2.Text = "第二個元素值:";
        // 
        // textBox6
        // 
        this.textBox6.Location = new System.Drawing.Point(111, 103);
        this.textBox6.Name = "textBox6";
        this.textBox6.ReadOnly = true;
        this.textBox6.Size = new System.Drawing.Size(119, 21);
        this.textBox6.TabIndex = 6;
        this.textBox6.Text = "Sex";
        // 
        // label7
        // 
        this.label7.AutoSize = true;
        this.label7.Location = new System.Drawing.Point(12, 106);
        this.label7.Name = "label7";
        this.label7.Size = new System.Drawing.Size(101, 12);
        this.label7.TabIndex = 12;
        this.label7.Text = "第二個元素名稱:";
        // 
        // textBox5
        // 
        this.textBox5.Location = new System.Drawing.Point(319, 75);
        this.textBox5.Name = "textBox5";
        this.textBox5.Size = new System.Drawing.Size(119, 21);
        this.textBox5.TabIndex = 5;
        // 
        // label5
        // 
        this.label5.AutoSize = true;
        this.label5.Location = new System.Drawing.Point(236, 78);
        this.label5.Name = "label5";
        this.label5.Size = new System.Drawing.Size(89, 12);
        this.label5.TabIndex = 10;
        this.label5.Text = "第一個元素值:";
        // 
        // textBox4
        // 
        this.textBox4.Location = new System.Drawing.Point(111, 75);
        this.textBox4.Name = "textBox4";
        this.textBox4.ReadOnly = true;
        this.textBox4.Size = new System.Drawing.Size(119, 21);
        this.textBox4.TabIndex = 4;
        this.textBox4.Text = "Name";
        // 
        // label6
        // 
        this.label6.AutoSize = true;
        this.label6.Location = new System.Drawing.Point(12, 78);
        this.label6.Name = "label6";
        this.label6.Size = new System.Drawing.Size(101, 12);
        this.label6.TabIndex = 8;
        this.label6.Text = "第一個元素名稱:";
        // 
        // textBox3
        // 
        this.textBox3.Location = new System.Drawing.Point(111, 47);
        this.textBox3.Name = "textBox3";
        this.textBox3.ReadOnly = true;
        this.textBox3.Size = new System.Drawing.Size(119, 21);
        this.textBox3.TabIndex = 2;
        this.textBox3.Text = "ID";
        // 
        // label3
        // 
        this.label3.AutoSize = true;
        this.label3.Location = new System.Drawing.Point(28, 50);
        this.label3.Name = "label3";
        this.label3.Size = new System.Drawing.Size(77, 12);
        this.label3.TabIndex = 6;
        this.label3.Text = "子節(jié)點屬性:";
        // 
        // textBox2
        // 
        this.textBox2.Location = new System.Drawing.Point(319, 20);
        this.textBox2.Name = "textBox2";
        this.textBox2.ReadOnly = true;
        this.textBox2.Size = new System.Drawing.Size(119, 21);
        this.textBox2.TabIndex = 1;
        this.textBox2.Text = "People";
        // 
        // label4
        // 
        this.label4.AutoSize = true;
        this.label4.Location = new System.Drawing.Point(248, 23);
        this.label4.Name = "label4";
        this.label4.Size = new System.Drawing.Size(77, 12);
        this.label4.TabIndex = 4;
        this.label4.Text = "子節(jié)點名稱:";
        // 
        // textBox1
        // 
        this.textBox1.Location = new System.Drawing.Point(111, 20);
        this.textBox1.Name = "textBox1";
        this.textBox1.ReadOnly = true;
        this.textBox1.Size = new System.Drawing.Size(119, 21);
        this.textBox1.TabIndex = 0;
        this.textBox1.Text = "Peoples";
        // 
        // label1
        // 
        this.label1.AutoSize = true;
        this.label1.Location = new System.Drawing.Point(19, 23);
        this.label1.Name = "label1";
        this.label1.Size = new System.Drawing.Size(89, 12);
        this.label1.TabIndex = 0;
        this.label1.Text = "頂級節(jié)點名稱:";
        // 
        // groupBox2
        // 
        this.groupBox2.Controls.Add(this.button4);
        this.groupBox2.Controls.Add(this.button3);
        this.groupBox2.Controls.Add(this.button2);
        this.groupBox2.Controls.Add(this.comboBox1);
        this.groupBox2.Controls.Add(this.textBox12);
        this.groupBox2.Controls.Add(this.label12);
        this.groupBox2.Controls.Add(this.label13);
        this.groupBox2.Controls.Add(this.textBox11);
        this.groupBox2.Controls.Add(this.label14);
        this.groupBox2.Location = new System.Drawing.Point(6, 198);
        this.groupBox2.Name = "groupBox2";
        this.groupBox2.Size = new System.Drawing.Size(451, 80);
        this.groupBox2.TabIndex = 19;
        this.groupBox2.TabStop = false;
        this.groupBox2.Text = "操作XML文件";
        // 
        // button4
        // 
        this.button4.Location = new System.Drawing.Point(360, 47);
        this.button4.Name = "button4";
        this.button4.Size = new System.Drawing.Size(63, 23);
        this.button4.TabIndex = 16;
        this.button4.Text = "刪除";
        this.button4.UseVisualStyleBackColor = true;
        this.button4.Click += new System.EventHandler(this.button4_Click);
        // 
        // button3
        // 
        this.button3.Location = new System.Drawing.Point(291, 47);
        this.button3.Name = "button3";
        this.button3.Size = new System.Drawing.Size(63, 23);
        this.button3.TabIndex = 15;
        this.button3.Text = "修改";
        this.button3.UseVisualStyleBackColor = true;
        this.button3.Click += new System.EventHandler(this.button3_Click);
        // 
        // button2
        // 
        this.button2.Location = new System.Drawing.Point(222, 47);
        this.button2.Name = "button2";
        this.button2.Size = new System.Drawing.Size(63, 23);
        this.button2.TabIndex = 14;
        this.button2.Text = "添加";
        this.button2.UseVisualStyleBackColor = true;
        this.button2.Click += new System.EventHandler(this.button2_Click);
        // 
        // comboBox1
        // 
        this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
        this.comboBox1.FormattingEnabled = true;
        this.comboBox1.Items.AddRange(new object[] {
        "男",
        "女"});
        this.comboBox1.Location = new System.Drawing.Point(286, 20);
        this.comboBox1.Name = "comboBox1";
        this.comboBox1.Size = new System.Drawing.Size(121, 20);
        this.comboBox1.TabIndex = 12;
        // 
        // textBox12
        // 
        this.textBox12.Location = new System.Drawing.Point(85, 49);
        this.textBox12.Name = "textBox12";
        this.textBox12.Size = new System.Drawing.Size(119, 21);
        this.textBox12.TabIndex = 13;
        // 
        // label12
        // 
        this.label12.AutoSize = true;
        this.label12.Location = new System.Drawing.Point(19, 52);
        this.label12.Name = "label12";
        this.label12.Size = new System.Drawing.Size(65, 12);
        this.label12.TabIndex = 27;
        this.label12.Text = "職工薪水:";
        // 
        // label13
        // 
        this.label13.AutoSize = true;
        this.label13.Location = new System.Drawing.Point(220, 23);
        this.label13.Name = "label13";
        this.label13.Size = new System.Drawing.Size(65, 12);
        this.label13.TabIndex = 25;
        this.label13.Text = "職工性別:";
        // 
        // textBox11
        // 
        this.textBox11.Location = new System.Drawing.Point(85, 20);
        this.textBox11.Name = "textBox11";
        this.textBox11.Size = new System.Drawing.Size(119, 21);
        this.textBox11.TabIndex = 11;
        // 
        // label14
        // 
        this.label14.AutoSize = true;
        this.label14.Location = new System.Drawing.Point(19, 23);
        this.label14.Name = "label14";
        this.label14.Size = new System.Drawing.Size(65, 12);
        this.label14.TabIndex = 23;
        this.label14.Text = "職工姓名:";
        // 
        // dataGridView1
        // 
        this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
        this.dataGridView1.Location = new System.Drawing.Point(6, 284);
        this.dataGridView1.Name = "dataGridView1";
        this.dataGridView1.RowTemplate.Height = 23;
        this.dataGridView1.Size = new System.Drawing.Size(451, 171);
        this.dataGridView1.TabIndex = 17;
        this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(462, 460);
        this.Controls.Add(this.dataGridView1);
        this.Controls.Add(this.groupBox2);
        this.Controls.Add(this.groupBox1);
        this.Name = "Form1";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "使用Linq To XML操作XML文件";
        this.Load += new System.EventHandler(this.Form1_Load);
        this.groupBox1.ResumeLayout(false);
        this.groupBox1.PerformLayout();
        this.groupBox2.ResumeLayout(false);
        this.groupBox2.PerformLayout();
        ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
        this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.GroupBox groupBox1;
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.TextBox textBox5;
    private System.Windows.Forms.Label label5;
    private System.Windows.Forms.TextBox textBox4;
    private System.Windows.Forms.Label label6;
    private System.Windows.Forms.TextBox textBox3;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.TextBox textBox2;
    private System.Windows.Forms.Label label4;
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.TextBox textBox7;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox textBox6;
    private System.Windows.Forms.Label label7;
    private System.Windows.Forms.TextBox textBox9;
    private System.Windows.Forms.Label label8;
    private System.Windows.Forms.TextBox textBox8;
    private System.Windows.Forms.Label label9;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.TextBox textBox10;
    private System.Windows.Forms.Label label10;
    private System.Windows.Forms.GroupBox groupBox2;
    private System.Windows.Forms.DataGridView dataGridView1;
    private System.Windows.Forms.TextBox textBox12;
    private System.Windows.Forms.Label label12;
    private System.Windows.Forms.Label label13;
    private System.Windows.Forms.TextBox textBox11;
    private System.Windows.Forms.Label label14;
    private System.Windows.Forms.ComboBox comboBox1;
    private System.Windows.Forms.Button button4;
    private System.Windows.Forms.Button button3;
    private System.Windows.Forms.Button button2;
}

到此這篇關(guān)于C#實現(xiàn)利用Linq操作Xml文件的文章就介紹到這了,更多相關(guān)C# Linq操作Xml內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • C#中重載與重寫區(qū)別分析

    C#中重載與重寫區(qū)別分析

    這篇文章主要為大家詳細介紹了C#中重載與重寫的區(qū)別,感興趣的小伙伴們可以參考一下
    2016-02-02
  • C#實現(xiàn)折半查找算法

    C#實現(xiàn)折半查找算法

    這篇文章介紹了C#實現(xiàn)折半查找的算法,文中通過示例代碼介紹的非常詳細。對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-08-08
  • C#?WPF調(diào)用QT窗口的方法

    C#?WPF調(diào)用QT窗口的方法

    本文主要介紹了C#?WPF調(diào)用QT窗口的方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2023-02-02
  • C#巧用DateTime預設(shè)可選的日期范圍(如本年度、本季度、本月等)

    C#巧用DateTime預設(shè)可選的日期范圍(如本年度、本季度、本月等)

    這篇文章主要介紹了C#巧用DateTime預設(shè)可選的日期范圍,如本年度、本季度、本月等,感興趣的小伙伴們可以參考一下
    2016-04-04
  • C#字符串內(nèi)存駐留機制分析

    C#字符串內(nèi)存駐留機制分析

    這篇文章介紹了C#字符串內(nèi)存駐留機制,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2022-01-01
  • C#判斷字符串中內(nèi)容是否為純數(shù)字的詳細教程

    C#判斷字符串中內(nèi)容是否為純數(shù)字的詳細教程

    在進行C#編程時候,有的時候我們需要判斷一個字符串是否是數(shù)字字符串,下面這篇文章主要給大家介紹了關(guān)于C#判斷字符串中內(nèi)容是否為純數(shù)字的詳細教程,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下
    2023-04-04
  • 一則C#簡潔瀑布流代碼

    一則C#簡潔瀑布流代碼

    最近想實現(xiàn)數(shù)據(jù)的延遲加載,網(wǎng)上找一下有很多例子,看了Masonry的例子啟發(fā),自己寫了一個很簡潔的代碼。分享給大家
    2014-06-06
  • WPF使用Dragablz構(gòu)建可拖拽分離的Tab頁程序

    WPF使用Dragablz構(gòu)建可拖拽分離的Tab頁程序

    這篇文章介紹了WPF使用Dragablz構(gòu)建可拖拽分離Tab頁的方法,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2022-06-06
  • C#中List和SortedList的簡介

    C#中List和SortedList的簡介

    今天小編就為大家分享一篇關(guān)于C#中List和SortedList的簡介,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
    2018-10-10
  • C#中using的三種用法

    C#中using的三種用法

    C#中using的三種用法...
    2007-04-04

最新評論