temz 2023-03-26 16:02 采纳率: 100%
浏览 76
已结题

C#winform treeview代码,请给加下注释

img

这是一个winform的treeview可以建立用户组和在用户组中建立用户,并使用xml保存数据,下面是相关代码,太多了,看不懂能不能给写一下注释越详细越好,另外前面的勾选框能不能告诉下怎么去掉。

下面是主界面的代码DBView.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;

using System.Collections;
using TreeView;

namespace GlassProcess
{
    public partial class DbView : Form
    {
       
        string filepath;
        string menufilepath;
        string proname;
        public string unit;
        public string user;
        public string company;
      
        private bool tmpBool;
        XmlOperator xml;
        bool haveUser = false;
        
        public DbView( )
        {
            filepath = Application.StartupPath;
            menufilepath = filepath + "\\Menu.xml";
            xml = new XmlOperator(filepath, "Menu.xml");
           
            InitializeComponent();
           
        }

        private void DbView_Load(object sender, EventArgs e)
        {
            LoadFormXml();
        }

        //载入数据 生成列表
        private void LoadFormXml()
        {
            XmlNodeList xmlNodes = xml.GetXmlNodeList();
            this.treeView1.BeginUpdate();
            this.treeView1.Nodes.Clear();
            XmlNode2TreeNode(xmlNodes, this.treeView1.Nodes);
            this.treeView1.EndUpdate();
            ExpandRoot(this.treeView1.Nodes);
        }

        //展开节点
        private void ExpandRoot(TreeNodeCollection treeNodes)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                if (treeNode.Tag.ToString().Equals("root"))
                {
                    treeNode.Expand();
                }
                else if (treeNode.Tag.ToString().Equals("area"))
                {
                    treeNode.Collapse();
                }
                if (treeNode.Nodes.Count > 0)
                {
                    ExpandRoot(treeNode.Nodes);
                }
            }
        }
        


        private void XmlNode2TreeNode(XmlNodeList xmlNode, TreeNodeCollection treeNode)
        {
            foreach (XmlNode var in xmlNode)
            {
                if (var.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                TreeNode newTreeNode = new TreeNode();
                newTreeNode.Text = var.Attributes["Title"].Value;

                if (var.HasChildNodes)
                {
                    if (var.ChildNodes[0].NodeType == XmlNodeType.CDATA)
                    {
                        newTreeNode.Tag = var.ChildNodes[0].Value;
                        if (newTreeNode.Tag.ToString().Equals("root"))
                        {
                            newTreeNode.ImageIndex = 0;
                            newTreeNode.SelectedImageIndex = 0;
                            newTreeNode.Expand();
                        }
                        else if (newTreeNode.Tag.ToString().Equals("area"))
                        {
                            newTreeNode.ImageIndex = 1;
                            newTreeNode.SelectedImageIndex = 1;
                           
                        }
                        else
                        {
                            newTreeNode.ImageIndex = 2;
                            newTreeNode.SelectedImageIndex = 2;
                        }

                    }

                    XmlNode2TreeNode(var.ChildNodes, newTreeNode.Nodes);
                }
                treeNode.Add(newTreeNode);
            }
        }

        private void treeView1_MouseUp(object sender, MouseEventArgs e)
        {
            try
            {
                Point mpt = new Point(e.X, e.Y);
                TreeNode TreeClickNode = this.treeView1.GetNodeAt(mpt);
                this.treeView1.SelectedNode = TreeClickNode;
                proname = TreeClickNode.Text;

                if (TreeClickNode != null)
                {
                    CreatMenu(TreeClickNode.Tag.ToString());
                    if (e.Button == MouseButtons.Right)
                    {

                        this.contextMenuStrip.Show(this.treeView1, mpt);
                        //this.treeView1.ContextMenu.Show(treeView1,mpt);
                    }
                }
                else
                {
                    contextMenuStrip.Items.Clear();
                }
            }
            catch
            { 
            
            }
        }

        private void CreatMenu(string p)
        {
            switch (p)
            {

                case "root":
                    {
                        this.contextMenuStrip.Items.Clear();

                        ToolStripMenuItem AddArea = new ToolStripMenuItem();
                        AddArea.Name = "新增用户分区";
                        AddArea.Text = "新增用户分区";
                        AddArea.Click += new System.EventHandler(AddArea_Click);

                        


                    

                        contextMenuStrip.Items.AddRange(
                             new System.Windows.Forms.ToolStripItem[] { 
                           AddArea
                        }
                        );
                    }
                break;
                case "area":
                {
                    this.contextMenuStrip.Items.Clear();
                    ToolStripMenuItem AddUser = new ToolStripMenuItem();
                    AddUser.Name = "添加用户";
                    AddUser.Text = "添加用户";
                    AddUser.Image = this.treeImgs.Images[3];
                    AddUser.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                    AddUser.Click += new System.EventHandler(AddUser_Click);

                    

                    ToolStripMenuItem DeleteArea = new ToolStripMenuItem();
                    DeleteArea.Name = "删除组";
                    DeleteArea.Text = "删除组";
                    DeleteArea.Click += new System.EventHandler(DeleteArea_Click);

                    





                    contextMenuStrip.Items.AddRange(
                         new System.Windows.Forms.ToolStripItem[] { 
                           AddUser,DeleteArea       
                        }
                    );
                }
                break;
                case "user":
                {
                    this.contextMenuStrip.Items.Clear();

      

                    ToolStripMenuItem DeleteUser = new ToolStripMenuItem();
                    DeleteUser.Name = "删除用户";
                    DeleteUser.Text = "删除用户";
                    DeleteUser.Click += new System.EventHandler(DeleteUser_Click);


                  

                    contextMenuStrip.Items.AddRange(
                         new System.Windows.Forms.ToolStripItem[] { 
                           
                             DeleteUser                  
                        }
                    );
                }
                break;
            }
        }
        private void ContractListBakRootItem_Click(object sender, EventArgs e)
        {
            
            //this.treeView1.ExpandAll();
        }

        private void ContractListBakGroupItem_Click(object sender, EventArgs e)
        {
            List<string> array = new List<string>();
            foreach (TreeNode node in this.treeView1.SelectedNode.Nodes)
            {
                array.Add((node.Text.Split('/'))[0]);
            }

         
            //this.treeView1.ExpandAll();
        }

        private void ImportDataUser_Click(object sender, EventArgs e)
        {
          
            //this.treeView1.ExpandAll();
        }
        private void SearchTreeNode(TreeNodeCollection treeNodes,string fileName)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                if (treeNode.Tag.ToString() == "user")
                {
                    if (treeNode.Text.Equals(fileName))
                    {
                        this.treeView1.Nodes.Remove(treeNode);
                    }
                    continue;
                }

                if (treeNode.Nodes.Count > 0)
                {
                    SearchTreeNode(treeNode.Nodes, fileName);
                }
            }
        }
        


        private TreeNode CreateChildNodeByImport(string file)
        {
            TreeNode node = new TreeNode(file);
            node.Tag = "user";
            return node;
        }

        private void ExportUserData_Click(object sender, EventArgs e)
        {
           
        }


        private void UpdateUserInfo_Click(object sender, EventArgs e)
        {
           
        }

        private void SendAndGetListByRoot_Click(object sender, EventArgs e)
        {
          
            //this.treeView1.ExpandAll();
        }

        private void SendAndGetListBakRootItem_Click(object sender, EventArgs e)
        {
            
            //this.treeView1.ExpandAll();
        }

        
        private void SendAndGetListByGroup_Click(object sender, EventArgs e)
        {
            
            //this.treeView1.ExpandAll();
        }
        private void SendAndGetListBakGroupItem_Click(object sender, EventArgs e)
        {
            //this.treeView1.ExpandAll();
        }

        
        private void CheckListByRoot_Click(object sender, EventArgs e)
        {
           
            //this.treeView1.ExpandAll();
        }
        private void CheckListBakRootItem_Click(object sender, EventArgs e)
        {
            
        
        }
        

        private void CheckListByGroup_Click(object sender, EventArgs e)
        {
            
            //this.treeView1.ExpandAll();
        }
        private void CheckListBakGroupItem_Click(object sender, EventArgs e)
        {
           
           // this.treeView1.ExpandAll();
        }

        
        private void BaitingListByRoot_Click(object sender, EventArgs e)
        {
           
         
           // this.treeView1.ExpandAll();
        }

        private void BaitingListBakRootItem_Click(object sender, EventArgs e)
        {
           
         
        }

        

        private void BaitingListByGroup_Click(object sender, EventArgs e)
        {
          
        }


        private void BaitingListBakGroupItem_Click(object sender, EventArgs e)
        {
            
        }
        

        private void ProcessListByRoot_Click(object sender, EventArgs e)
        {
            

        }
        private void ProcessListBakRootItem_Click(object sender, EventArgs e)
        {
            

            
            //this.treeView1.ExpandAll();
        }


        private void ProcessListByGroup_Click(object sender, EventArgs e)
        {
            
            //this.treeView1.ExpandAll();
        }

        private void ProcessListBakGroupItem_Click(object sender, EventArgs e)
        {
           
        }

        
        private void OrderListByRoot_Click(object sender, EventArgs e)
        {
           

            //this.treeView1.ExpandAll();
        }
        private void OrderListBakRootItem_Click(object sender, EventArgs e)
        {


            
            //this.treeView1.ExpandAll();
        }


        private void OrderListByGroup_Click(object sender, EventArgs e)
        {
         
        }
        private void OrderListBakGroupItem_Click(object sender, EventArgs e)
        {
        }


        private void BakSendAndGetList_Click(object sender, EventArgs e)
        {
        }

        private void BakCheckList_Click(object sender, EventArgs e)
        {
           
        }

        private void BakBaitingList_Click(object sender, EventArgs e)
        {
          
        }
        private void BakListItem_Click(object sender, EventArgs e)
        {
            
        }

        private void BakProcessList_Click(object sender, EventArgs e)
        {
        }

        private void BakOrderList_Click(object sender, EventArgs e)
        {
           
        }

        private void SendAndGetList_Click(object sender, EventArgs e)
        {
          
        }

        private void CheckList_Click(object sender, EventArgs e)
        {
         
        }

        private void ProcessList_Click(object sender, EventArgs e)
        {

        }


        private void BaitingList_Click(object sender, EventArgs e)
        {

          
        }

        private void OrderList_Click(object sender, EventArgs e)
        {
            
               
        }

        private void StatisticsRoot_Click(object sender, EventArgs e)
        {
           
        }

        private void StatisticsListByGroup_Click(object sender, EventArgs e)
        {
           
        }

        private void ContractListByRoot_Click(object sender, EventArgs e)
        {
           
        }


        private void AddArea_Click(object sender, EventArgs e)
        {
            AddUnit form = new AddUnit(this);
            form.ShowDialog();
            if (!string.IsNullOrEmpty(unit))
            {
                TreeNode node = CreateRootNode();

                //this.treeView1.Nodes.
                //TreeNode root = this.treeView1.Nodes[0];
                this.treeView1.Nodes[0].Nodes.Add(node);
                SaveToXml();
                LoadFormXml();
            }
            //this.treeView1.ExpandAll();
        }
        private void RemoveUser(TreeNodeCollection treeNodes)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                if (treeNode.Tag.ToString().Equals("user"))
                {
                    if (treeNode.Text.Equals(user))
                    {
                        treeNode.Remove();
                    }
                }
                if (treeNode.Nodes.Count > 0)
                {
                    RemoveUser(treeNode.Nodes);
                }
            }
        }


        private void AddUser_Click(object sender, EventArgs e)
        {
            AddUser form = new AddUser(this);
            if (form.ShowDialog() == DialogResult.OK)
            {
                if (!string.IsNullOrEmpty(user))
                {
                    
                    CheckUser(this.treeView1.Nodes);
                    if (haveUser)
                    {
                        if (MessageBox.Show("该用户[" + user + "]已经存在,是否覆盖?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                        {
                            RemoveUser(this.treeView1.Nodes);
                            TreeNode node = CreateChildNode();
                            TreeNode selectNode = this.treeView1.SelectedNode;
                            selectNode.Nodes.Add(node);
                            SaveToXml();
                            LoadFormXml();
                        }
                        else
                        {
                            //SetNodeBackColor(this.treeView1.Nodes);
                        }
                    }
                    else
                    {
                        TreeNode node = CreateChildNode();
                        TreeNode selectNode = this.treeView1.SelectedNode;
                        selectNode.Nodes.Add(node);
                        SaveToXml();
                        LoadFormXml();

                    }
                   
                }
            }
            haveUser = false;
        }

        private void CheckUser(TreeNodeCollection treeNodes)
        {
            tmpBool = false;
            foreach (TreeNode treeNode in treeNodes)
            {
                if (treeNode.Tag.ToString().Equals("user"))
                {
                    if (treeNode.Text.Equals(user))
                    {
                        treeNode.BackColor = Color.Red;
                        //treeNode
                        treeNode.Parent.Expand();
                        haveUser = true;
                    }
                }
                if (treeNode.Nodes.Count > 0)
                {
                    CheckUser(treeNode.Nodes);
                }
            }
        }

        private void DeleteUser_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("你确定要删除吗?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                if (this.treeView1.SelectedNode == null)
                {
                    return;
                }
                string[] array = this.treeView1.SelectedNode.Text.Split('/');
                this.treeView1.Nodes.Remove(this.treeView1.SelectedNode);
                SaveToXml();
                LoadFormXml();
               
                
              
            }
        }
        private void DeleteArea_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("你确定要删除吗?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
            {
                if (this.treeView1.SelectedNode == null)
                {
                    return;
                }

                if (this.treeView1.SelectedNode.Tag.ToString() == "area")
                {
                    List<string> array = new List<string>();
                    foreach (TreeNode node in this.treeView1.SelectedNode.Nodes)
                    {
                        array.Add((node.Text.Split('/'))[0]);
                    }
                    if (array.Count != 0)
                    {
                        MessageBox.Show("不能删除非空用户的组结点!", "确定", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        this.treeView1.Nodes.Remove(this.treeView1.SelectedNode);
                        SaveToXml();
                        LoadFormXml();
                        //binary.DeleteAccountDirectory(array[0]);
                     
                    }
                   
                }
            }
        }


        private void ListItem_Click(object sender, EventArgs e)
        {
           
        }

        private void AddTabPage(string pageTitle, Control ctrForm)
        {
           
        }

        private void treeView1_DoubleClick(object sender, EventArgs e)
        {
            
        }

        private void toolbtn_AddUnit_Click(object sender, EventArgs e)
        {
            AddUnit form = new AddUnit(this);
            form.ShowDialog();
            if (!string.IsNullOrEmpty(unit))
            {
                TreeNode node = CreateRootNode();

                //this.treeView1.Nodes.
                //TreeNode root = this.treeView1.Nodes[0];
                this.treeView1.Nodes[0].Nodes.Add(node);
                //this.treeView1.Nodes["root"].Nodes.Add(node);
                SaveToXml();
                LoadFormXml();
            }
            //this.treeView1.ExpandAll();
            
        }
        private TreeNode CreateRootNode()
        {
            TreeNode node = new TreeNode(this.unit);
            node.Tag = "area";
            node.ImageIndex = 1;
            node.SelectedImageIndex = 1;
            return node;
        }
        private TreeNode CreateChildNode()
        {
            TreeNode node = new TreeNode(this.user);
            node.Tag = "user";
            node.ImageIndex = 2;
            node.SelectedImageIndex = 2;
            return node;
        }


        public void SaveToXml()
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml("<Menu></Menu>");
            XmlNode root = doc.DocumentElement;
            doc.InsertBefore(doc.CreateXmlDeclaration("1.0", "utf-8", "yes"), root);
            TreeNode2Xml(this.treeView1.Nodes, root);
            xml.SaveXml(doc);
        }

        private void TreeNode2Xml(TreeNodeCollection treeNodes, XmlNode xmlNode)
        {
            XmlDocument doc = xmlNode.OwnerDocument;
            foreach (TreeNode treeNode in treeNodes)
            {
                XmlNode element = doc.CreateNode("element", "Item", "");
                XmlAttribute attr = doc.CreateAttribute("Title");
                attr.Value = treeNode.Text;
                element.Attributes.Append(attr);
                element.AppendChild(doc.CreateCDataSection(treeNode.Tag.ToString()));
                xmlNode.AppendChild(element);

                if (treeNode.Nodes.Count > 0)
                {
                    TreeNode2Xml(treeNode.Nodes, element);
                }
            }
        }
        
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string path = null;
            TreeNode node = this.treeView1.SelectedNode;
            //node.ForeColor = Color.Red;
            if (node != null)
            {
                path = node.Text;
                while (node.Parent != null)
                {
                    node = node.Parent;
                    path = node.Text + "\\" + path;
                }
            }
            
        }

        private void treeView1_Click(object sender, EventArgs e)
        {
            //this.treeView1.Nodes.f
            object tmpObj = this.treeView1.GetNodeAt(this.treeView1.PointToClient(Cursor.Position));
            if (tmpObj != null)
            {
                if ((tmpObj as TreeNode).Bounds.Contains(this.treeView1.PointToClient(Cursor.Position)))
                {
                    tmpBool = true;
                }
            }
        }

        private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
        {
            if (tmpBool)
            {
                e.Cancel = tmpBool;
            }
            tmpBool = false; 
        }

        private void treeView1_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
        {
            if (tmpBool)
            {
                e.Cancel = tmpBool;
            }
            tmpBool = false;

        }

        private void treeView1_MouseClick(object sender, MouseEventArgs e)
        {
            
        }
      
        private void treeView1_MouseMove(object sender, MouseEventArgs e)
        {
           
        }

        private void treeView1_MouseLeave(object sender, EventArgs e)
        {
           

        }

        private void toolbtnSearch_Click(object sender, EventArgs e)
        {
            string searchName = this.toolText.Text;
            SetNodeBackColor(this.treeView1.Nodes);
            if (!string.IsNullOrEmpty(searchName))
            {
                SearchXml(this.treeView1.Nodes, searchName);
            }
        }
        private void SetNodeBackColor(TreeNodeCollection treeNodes)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                treeNode.BackColor = Color.White;
                if (treeNode.Tag.ToString().Equals("area"))
                {
                    treeNode.Collapse();
                }
                if (treeNode.Nodes.Count > 0)
                {
                    SetNodeBackColor(treeNode.Nodes);
                }
            }
        }

        private void SearchXml(TreeNodeCollection treeNodes,string search)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                if (treeNode.Text.ToString().Contains(search))
                {
                    treeNode.BackColor = Color.Coral;
                    if(treeNode.Parent!=null)
                    {
                        treeNode.Parent.Expand();
                    }
                }
                if (treeNode.Nodes.Count > 0)
                {
                    SearchXml(treeNode.Nodes,search);
                }
            }
        }

        private void toolText_TextChanged(object sender, EventArgs e)
        {
            toolbtnSearch_Click(sender, e);
        }

        //节点的选中取消事件
        private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Checked)
            {
               setChildNodeCheckedState(e.Node, true);
            }
            else
            {
                setChildNodeCheckedState(e.Node,  false);
            }
        }


        //选中节点之后,选中节点的所有子节点
        private void setChildNodeCheckedState(TreeNode currNode, bool state)
        {
            TreeNodeCollection nodes = currNode.Nodes;
            if (nodes.Count > 0)
                foreach (TreeNode tn in nodes)
                {

                    tn.Checked = state;
                    setChildNodeCheckedState(tn, state);
                }
        }
    }
}

这个是class1的代码

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Windows.Forms;

namespace TreeView
{
    public class XmlOperator
    {
        private string filepath;    //文件路径
        public const string xmlContent = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><Menu><Item Title=\"所有\"><![CDATA[root]]></Item></Menu>";
        public string Filepath
        {
            get { return filepath; }
            set { filepath = value; }
        }
        private string filename;    //Xml文件名

        public string Filename
        {
            get { return filename; }
            set { filename = value; }
        }
        public XmlOperator(string filepath, string filename)
        {
            this.filepath = filepath + "\\" + filename;
            this.filename = filename;
        }

        public XmlNodeList GetXmlNodeList()
        {
            try
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(filepath);
                XmlNodeList xmlNodes = xmlDoc.DocumentElement.ChildNodes;
                return xmlNodes;
            }
            catch
            {
                MessageBox.Show("用户目录文件已损坏,自动恢复到初始状态!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                RecoverXml();
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(filepath);
                XmlNodeList xmlNodes = xmlDoc.DocumentElement.ChildNodes;
                return xmlNodes;
            }
        }

        public void RecoverXml()
        {
            XmlDocument doc = new XmlDocument();
            doc.InnerXml = xmlContent;
            this.SaveXml(doc);
        }

        public void SaveXml(XmlDocument doc)
        {
            doc.Save(filepath);
        }


    }
}

添加用户组界面代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GlassProcess
{
    public partial class AddUnit : Form
    {
        DbView dbview; //当然就是DbView
        public AddUnit(DbView form)
        {
            InitializeComponent();
            dbview = form;
        }

        /// 
        /// 把dbview中的unit单元设置为txtUnit的值,且关闭窗体
        /// 
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void btnAdd_Click(object sender, EventArgs e)
        {
            dbview.unit = this.txtUnit.Text;
            this.Close();
        }

        private void AddUnit_Load(object sender, EventArgs e)
        {

        }
    }
}

添加用户界面代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GlassProcess
{
    public partial class AddUser : Form
    {
        private DbView form;//还是DbView
        public AddUser(DbView from)
        {
            InitializeComponent();
            this.form = from;

        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            form.user = this.txtUser.Text.Trim(); //将dbView中的user设置为txtUser.Text的值
            DialogResult = DialogResult.OK;
            this.Close();
        }

        private void AddUser_Load(object sender, EventArgs e)
        {

        }
    }
}

  • 写回答

3条回答 默认 最新

  • 「已注销」 2023-03-26 17:19
    关注

    引用GPT:DBView.cs注释后:

    namespace GlassProcess
    {
        public partial class DbView : Form
        {
            // 声明变量
            string filepath; // 文件路径
            string menufilepath; // 菜单文件路径
            string proname; // 项目名称
            public string unit; // 单位
            public string user; // 用户
            public string company; // 公司
    
            private bool tmpBool; // 临时变量
            XmlOperator xml; // XML操作类
            bool haveUser = false; // 标志是否有用户
    
            public DbView()
            {
                // 初始化变量
                filepath = Application.StartupPath; // 获取应用程序的启动路径
                menufilepath = filepath + "\\Menu.xml"; // 菜单文件路径
                xml = new XmlOperator(filepath, "Menu.xml"); // 创建XML操作类
    
                InitializeComponent(); // 初始化组件
            }
    
            private void DbView_Load(object sender, EventArgs e)
            {
                LoadFormXml(); // 载入数据,生成列表
            }
    
            // 载入数据,生成列表
            private void LoadFormXml()
            {
                XmlNodeList xmlNodes = xml.GetXmlNodeList(); // 获取XML节点列表
                this.treeView1.BeginUpdate(); // 开始更新TreeView
                this.treeView1.Nodes.Clear(); // 清空TreeView节点
                XmlNode2TreeNode(xmlNodes, this.treeView1.Nodes); // 节点转换为TreeView节点
                this.treeView1.EndUpdate(); // 结束更新TreeView
                ExpandRoot(this.treeView1.Nodes); // 展开TreeView根节点
            }
    
            // 展开节点
            private void ExpandRoot(TreeNodeCollection treeNodes)
            {
                foreach (TreeNode treeNode in treeNodes)
                {
                    if (treeNode.Tag.ToString().Equals("root")) // 如果是根节点
                    {
                        treeNode.Expand(); // 展开节点
                    }
                    else if (treeNode.Tag.ToString().Equals("area")) // 如果是区域节点
                    {
                        treeNode.Collapse(); // 折叠节点
                    }
                    if (treeNode.Nodes.Count > 0) // 如果有子节点
                    {
                        ExpandRoot(treeNode.Nodes); // 递归展开子节点
                    }
                }
            }
        }
    }
    private void XmlNode2TreeNode(XmlNodeList xmlNode, TreeNodeCollection treeNode)
    {
        foreach (XmlNode var in xmlNode)
        {
            // 忽略非Element类型的节点
            if (var.NodeType != XmlNodeType.Element)
            {
                continue;
            }
            // 新建一个TreeNode,并根据XML节点的Title属性设置文本
            TreeNode newTreeNode = new TreeNode();
            newTreeNode.Text = var.Attributes["Title"].Value;
    
            // 如果XML节点有子节点,则递归调用XmlNode2TreeNode方法转换子节点
            if (var.HasChildNodes)
            {
                // 如果第一个子节点是CDATA,则将其内容作为TreeNode的Tag
                if (var.ChildNodes[0].NodeType == XmlNodeType.CDATA)
                {
                    newTreeNode.Tag = var.ChildNodes[0].Value;
                    if (newTreeNode.Tag.ToString().Equals("root"))
                    {
                        newTreeNode.ImageIndex = 0;
                        newTreeNode.SelectedImageIndex = 0;
                        newTreeNode.Expand();
                    }
                    else if (newTreeNode.Tag.ToString().Equals("area"))
                    {
                        newTreeNode.ImageIndex = 1;
                        newTreeNode.SelectedImageIndex = 1;
                    }
                    else
                    {
                        newTreeNode.ImageIndex = 2;
                        newTreeNode.SelectedImageIndex = 2;
                    }
                }
                // 将新建的TreeNode添加到父TreeNode的Nodes集合中
                XmlNode2TreeNode(var.ChildNodes, newTreeNode.Nodes);
            }
            // 将新建的TreeNode添加到TreeView的节点集合中
            treeNode.Add(newTreeNode);
        }
    }
    private void CreatMenu(string p)
    {
        switch (p)
        {
            case "root":
                {
                    //清空右键菜单
                    this.contextMenuStrip.Items.Clear();
                    //创建“新增用户分区”菜单项,并添加到右键菜单
                    ToolStripMenuItem AddArea = new ToolStripMenuItem();
                    AddArea.Name = "新增用户分区";
                    AddArea.Text = "新增用户分区";
                    AddArea.Click += new System.EventHandler(AddArea_Click);
                    contextMenuStrip.Items.AddRange(
                         new System.Windows.Forms.ToolStripItem[] { 
                       AddArea
                    }
                    );
                }
                break;
            case "area":
                {
                    //清空右键菜单
                    this.contextMenuStrip.Items.Clear();
                    //创建“添加用户”菜单项,并添加到右键菜单
                    ToolStripMenuItem AddUser = new ToolStripMenuItem();
                    AddUser.Name = "添加用户";
                    AddUser.Text = "添加用户";
                    AddUser.Image = this.treeImgs.Images[3];
                    AddUser.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                    AddUser.Click += new System.EventHandler(AddUser_Click);
                    //创建“删除组”菜单项,并添加到右键菜单
                    ToolStripMenuItem DeleteArea = new ToolStripMenuItem();
                    DeleteArea.Name = "删除组";
                    DeleteArea.Text = "删除组";
                    DeleteArea.Click += new System.EventHandler(DeleteArea_Click);
                    contextMenuStrip.Items.AddRange(
                         new System.Windows.Forms.ToolStripItem[] { 
                           AddUser,DeleteArea       
                        }
                    );
                }
                break;
            case "user":
                {
                    //清空右键菜单
                    this.contextMenuStrip.Items.Clear();
                    //创建“删除用户”菜单项,并添加到右键菜单
                    ToolStripMenuItem DeleteUser = new ToolStripMenuItem();
                    DeleteUser.Name = "删除用户";
                    DeleteUser.Text = "删除用户";
                    DeleteUser.Click += new System.EventHandler(DeleteUser_Click);
                    contextMenuStrip.Items.AddRange(
                         new System.Windows.Forms.ToolStripItem[] { 
                             DeleteUser                  
                        }
                    );
                }
                break;
        }
    }
    private void ContractListBakRootItem_Click(object sender, EventArgs e)
    {
        // 点击合同列表备份根目录菜单项的处理函数,暂未实现功能
        //this.treeView1.ExpandAll();
    }
    
    private void ContractListBakGroupItem_Click(object sender, EventArgs e)
    {
        // 点击合同列表备份分组菜单项的处理函数
        // 获取当前选中节点的所有子节点的第一段文本,并添加到字符串列表array中
        List<string> array = new List<string>();
        foreach (TreeNode node in this.treeView1.SelectedNode.Nodes)
        {
            array.Add((node.Text.Split('/'))[0]);
        }
    
        //this.treeView1.ExpandAll();
    }
    
    private void ImportDataUser_Click(object sender, EventArgs e)
    {
        // 点击导入用户数据菜单项的处理函数,暂未实现功能
        //this.treeView1.ExpandAll();
    }
    
    private void SearchTreeNode(TreeNodeCollection treeNodes,string fileName)
    {
        // 在指定的节点集合treeNodes中搜索名为fileName的节点并删除
        foreach (TreeNode treeNode in treeNodes)
        {
            if (treeNode.Tag.ToString() == "user")
            {
                if (treeNode.Text.Equals(fileName))
                {
                    this.treeView1.Nodes.Remove(treeNode);
                }
                continue;
            }
    
            if (treeNode.Nodes.Count > 0)
            {
                SearchTreeNode(treeNode.Nodes, fileName);
            }
        }
    }
    
    private TreeNode CreateChildNodeByImport(string file)
    {
        // 根据导入的文件名创建一个新的树节点并返回
        TreeNode node = new TreeNode(file);
        node.Tag = "user";
        return node;
    }
    
    private void ExportUserData_Click(object sender, EventArgs e)
    {
        // 点击导出用户数据菜单项的处理函数,暂未实现功能
    }
    
    private void UpdateUserInfo_Click(object sender, EventArgs e)
    {
        // 点击更新用户信息菜单项的处理函数,暂未实现功能
    }
    
    SendAndGetListByRoot_Click:发送请求并获取根目录下的文件列表。
    SendAndGetListBakRootItem_Click:发送请求并获取根目录下的备份文件列表。
    SendAndGetListByGroup_Click:发送请求并获取指定组下的文件列表。
    SendAndGetListBakGroupItem_Click:发送请求并获取指定组下的备份文件列表。
    CheckListByRoot_Click:检查根目录下的文件列表。
    CheckListBakRootItem_Click:检查根目录下的备份文件列表。
    CheckListByGroup_Click:检查指定组下的文件列表。
    CheckListBakGroupItem_Click:检查指定组下的备份文件列表。
    BaitingListByRoot_Click:检查根目录下的文件是否需要转储。
    BaitingListBakRootItem_Click:检查根目录下的备份文件是否需要转储。
    BaitingListByGroup_Click:检查指定组下的文件是否需要转储。
    BaitingListBakGroupItem_Click:检查指定组下的备份文件是否需要转储。
    ProcessListByRoot_Click:对根目录下的文件进行转储。
    ProcessListBakRootItem_Click:对根目录下的备份文件进行转储。
    ProcessListByGroup_Click、ProcessListBakGroupItem_Click、OrderListByRoot_Click、OrderListBakRootItem_Click、OrderListByGroup_Click 和 OrderListBakGroupItem_Click 这些方法似乎与树形控件有关,但目前它们的实现代码为空。需要根据实际代码逻辑来确定方法的作用。
    BakSendAndGetList_Click、BakCheckList_Click、BakBaitingList_Click、BakListItem_Click、BakProcessList_Click 和 BakOrderList_Click 这些方法名中的“Bak”字样可能表示“备份”或“撤销”操作,但也需要查看实际代码来确定方法的作用。
    SendAndGetList_Click、CheckList_Click、ProcessList_Click、BaitingList_Click、OrderList_Click、StatisticsRoot_Click、StatisticsListByGroup_Click 和 ContractListByRoot_Click 这些方法的作用也需要根据实际代码逻辑来确定。
    
    
    // 添加区域
    private void AddArea_Click(object sender, EventArgs e)
    {
    // 创建 AddUnit 窗体的实例
    AddUnit form = new AddUnit(this);
    // 显示窗体,等待用户输入
    form.ShowDialog();
    // 如果输入的单位名称不为空
    if (!string.IsNullOrEmpty(unit))
    {
    // 创建根节点
    TreeNode node = CreateRootNode();
    // 将根节点添加到 TreeView 控件中
    this.treeView1.Nodes[0].Nodes.Add(node);
    // 将更改保存到 XML 文件中
    SaveToXml();
    // 重新从 XML 文件中加载数据并更新 TreeView 控件
    LoadFormXml();
    }
    }
    
    // 递归查找并删除 TreeView 控件中指定用户的节点
    private void RemoveUser(TreeNodeCollection treeNodes)
    {
    foreach (TreeNode treeNode in treeNodes)
    {
    if (treeNode.Tag.ToString().Equals("user"))
    {
    if (treeNode.Text.Equals(user))
    {
    treeNode.Remove();
    }
    }
    if (treeNode.Nodes.Count > 0)
    {
    RemoveUser(treeNode.Nodes);
    }
    }
    }
    
    // 添加用户
    private void AddUser_Click(object sender, EventArgs e)
    {
    // 创建 AddUser 窗体的实例
    AddUser form = new AddUser(this);
    // 显示窗体,等待用户输入
    if (form.ShowDialog() == DialogResult.OK)
    {
    if (!string.IsNullOrEmpty(user))
    {
    // 检查 TreeView 控件中是否已经存在指定用户的节点
    CheckUser(this.treeView1.Nodes);
    if (haveUser)
    {
    // 如果用户已经存在,弹出确认对话框
    if (MessageBox.Show("该用户[" + user + "]已经存在,是否覆盖?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
    {
    // 删除原来的节点并创建新的节点
    RemoveUser(this.treeView1.Nodes);
    TreeNode node = CreateChildNode();
    TreeNode selectNode = this.treeView1.SelectedNode;
    selectNode.Nodes.Add(node);
    // 将更改保存到 XML 文件中
    SaveToXml();
    // 重新从 XML 文件中加载数据并更新 TreeView 控件
    LoadFormXml();
    }
    else
    {
    // 取消覆盖,不做任何操作
    }
    }
    else
    {
    // 如果用户不存在,创建新的节点
    TreeNode node = CreateChildNode();
    TreeNode selectNode = this.treeView1.SelectedNode;
    selectNode.Nodes.Add(node);
    // 将更改保存到 XML 文件中
    SaveToXml();
    // 重新从 XML 文件中加载数据并更新 TreeView 控件
    LoadFormXml();
    }
    }
    }
    // 重置 haveUser 标志位
    haveUser = false;
    }
    
    
    private void CheckUser(TreeNodeCollection treeNodes)
    {
        tmpBool = false;
        foreach (TreeNode treeNode in treeNodes)
        {
            if (treeNode.Tag.ToString().Equals("user"))
            {
                if (treeNode.Text.Equals(user))
                {
                    treeNode.BackColor = Color.Red; // 将节点的背景颜色设为红色
                    treeNode.Parent.Expand(); // 展开父节点
                    haveUser = true; // 设置haveUser为true,表示找到了该用户
                }
            }
            if (treeNode.Nodes.Count > 0)
            {
                CheckUser(treeNode.Nodes); // 递归调用CheckUser,查找子节点中是否存在该用户
            }
        }
    }
    
    private void DeleteUser_Click(object sender, EventArgs e)
    {
        if (MessageBox.Show("你确定要删除吗?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
        {
            if (this.treeView1.SelectedNode == null)
            {
                return;
            }
            string[] array = this.treeView1.SelectedNode.Text.Split('/'); // 将节点文本按照'/'分割成字符串数组
            this.treeView1.Nodes.Remove(this.treeView1.SelectedNode); // 移除选中节点
            SaveToXml(); // 保存到XML文件
            LoadFormXml(); // 从XML文件加载节点
        }
    }
    
    private void DeleteArea_Click(object sender, EventArgs e)
    {
        if (MessageBox.Show("你确定要删除吗?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
        {
            if (this.treeView1.SelectedNode == null)
            {
                return;
            }
    
            if (this.treeView1.SelectedNode.Tag.ToString() == "area")
            {
                List<string> array = new List<string>();
                foreach (TreeNode node in this.treeView1.SelectedNode.Nodes)
                {
                    array.Add((node.Text.Split('/'))[0]); // 将子节点的文本按照'/'分割成字符串数组,并取第一个元素,即用户名
                }
                if (array.Count != 0)
                {
                    MessageBox.Show("不能删除非空用户的组结点!", "确定", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    this.treeView1.Nodes.Remove(this.treeView1.SelectedNode); // 移除选中节点
                    SaveToXml(); // 保存到XML文件
                    LoadFormXml(); // 从XML文件加载节点
                    //binary.DeleteAccountDirectory(array[0]);
                }
            }
        }
    }
    
    
    // 点击列表项
    private void ListItem_Click(object sender, EventArgs e)
    {
    // TODO: 实现点击列表项后的操作
    }
    
    // 添加选项卡页
    private void AddTabPage(string pageTitle, Control ctrForm)
    {
    // TODO: 实现添加选项卡页的操作
    }
    
    // 双击树形视图
    private void treeView1_DoubleClick(object sender, EventArgs e)
    {
    // TODO: 实现双击树形视图后的操作
    }
    
    // 添加单元工具按钮的点击事件
    private void toolbtn_AddUnit_Click(object sender, EventArgs e)
    {
    // 打开添加单元的窗口
    AddUnit form = new AddUnit(this);
    form.ShowDialog();
    if (!string.IsNullOrEmpty(unit))
    {
    // 创建根节点
    TreeNode node = CreateRootNode();
    // 添加节点到树形视图中
        this.treeView1.Nodes[0].Nodes.Add(node);
    
        // 将树形视图保存到XML文件中
        SaveToXml();
    
        // 从XML文件中加载树形视图
        LoadFormXml();
    }
    }
    
    // 创建根节点
    private TreeNode CreateRootNode()
    {
    TreeNode node = new TreeNode(this.unit);
    node.Tag = "area";
    node.ImageIndex = 1;
    node.SelectedImageIndex = 1;
    return node;
    }
    
    // 创建子节点
    private TreeNode CreateChildNode()
    {
    TreeNode node = new TreeNode(this.user);
    node.Tag = "user";
    node.ImageIndex = 2;
    node.SelectedImageIndex = 2;
    return node;
    }
    
    // 将树形视图保存到XML文件中
    public void SaveToXml()
    {
    // 创建XML文档对象
    XmlDocument doc = new XmlDocument();
    // 创建根节点
    doc.LoadXml("<Menu></Menu>");
    XmlNode root = doc.DocumentElement;
    
    // 添加XML声明
    doc.InsertBefore(doc.CreateXmlDeclaration("1.0", "utf-8", "yes"), root);
    
    // 将树形视图转换为XML节点,并添加到XML文档中
    TreeNode2Xml(this.treeView1.Nodes, root);
    
    // 将XML文档保存到文件中
    xml.SaveXml(doc);
    }
    // 将TreeNodeCollection转换为XML节点
    private void TreeNode2Xml(TreeNodeCollection treeNodes, XmlNode xmlNode)
    {
    XmlDocument doc = xmlNode.OwnerDocument;
    foreach (TreeNode treeNode in treeNodes)
    {
    // 创建XML节点
    XmlNode element = doc.CreateNode("element", "Item", "");
    XmlAttribute attr = doc.CreateAttribute("Title");
    attr.Value = treeNode.Text;
    element.Attributes.Append(attr);
    element.AppendChild(doc.CreateCDataSection(treeNode.Tag.ToString()));
    xmlNode.AppendChild(element);
    // 如果该节点有子节点,则递归调用该方法
        if (treeNode.Nodes.Count > 0)
        {
            TreeNode2Xml(treeNode.Nodes, element);
        }
    }
    }
    
    // 当用户选中某个节点时发生的事件处理程序
    private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
    {
    string path = null;
    TreeNode node = this.treeView1.SelectedNode;
    //node.ForeColor = Color.Red;
    if (node != null)
    {
    path = node.Text;
    while (node.Parent != null)
    {
    node = node.Parent;
    path = node.Text + "\" + path;
    }
    }
    }
    
    // 当用户单击树形视图时发生的事件处理程序
    private void treeView1_Click(object sender, EventArgs e)
    {
    // 获取鼠标单击的位置上的节点
    object tmpObj = this.treeView1.GetNodeAt(this.treeView1.PointToClient(Cursor.Position));
    if (tmpObj != null)
    {
    if ((tmpObj as TreeNode).Bounds.Contains(this.treeView1.PointToClient(Cursor.Position)))
    {
    tmpBool = true;
    }
    }
    }
    
    // 当用户展开某个节点之前发生的事件处理程序
    private void treeView1_BeforeExpand(object sender, TreeViewCancelEventArgs e)
    {
    if (tmpBool)
    {
    e.Cancel = tmpBool;
    }
    tmpBool = false;
    }
    
    // 当用户折叠某个节点之前发生的事件处理程序
    private void treeView1_BeforeCollapse(object sender, TreeViewCancelEventArgs e)
    {
    if (tmpBool)
    {
    e.Cancel = tmpBool;
    }
    tmpBool = false;
    
    }
    
    // 当用户在树形视图上单击鼠标按钮时发生的事件处理程序
    private void treeView1_MouseClick(object sender, MouseEventArgs e)
    {
    
    }
    
    // 当用户在树形视图上移动鼠标时发生的事件处理程序
    private void treeView1_MouseMove(object sender, MouseEventArgs e)
    {
    
    }
    
    // 当鼠标离开树形视图时发生的事件处理程序
    private void treeView1_MouseLeave(object sender, EventArgs e)
    {
    
    }
    
    private void toolbtnSearch_Click(object sender, EventArgs e)
    {
    string searchName = this.toolText.Text;
    SetNodeBackColor(this.treeView1.Nodes); // 设置节点背景颜色为白色
    if (!string.IsNullOrEmpty(searchName))
    {
    SearchXml(this.treeView1.Nodes, searchName); // 根据搜索内容在TreeView中查找匹配节点
    }
    }
    
    private void SetNodeBackColor(TreeNodeCollection treeNodes)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                treeNode.BackColor = Color.White; // 设置节点背景颜色为白色
                if (treeNode.Tag.ToString().Equals("area")) // 如果节点的Tag属性值为"area",则将该节点折叠
                {
                    treeNode.Collapse();
                }
                if (treeNode.Nodes.Count > 0)
                {
                    SetNodeBackColor(treeNode.Nodes); // 递归调用SetNodeBackColor方法,对当前节点的所有子节点执行相同的操作
                }
            }
        }
    
        private void SearchXml(TreeNodeCollection treeNodes,string search)
        {
            foreach (TreeNode treeNode in treeNodes)
            {
                if (treeNode.Text.ToString().Contains(search)) // 如果当前节点的文本内容包含搜索内容,则将该节点的背景颜色设置为Coral色
                {
                    treeNode.BackColor = Color.Coral;
                    if(treeNode.Parent!=null) // 如果该节点有父节点,则展开其父节点
                    {
                        treeNode.Parent.Expand();
                    }
                }
                if (treeNode.Nodes.Count > 0)
                {
                    SearchXml(treeNode.Nodes,search); // 递归调用SearchXml方法,对当前节点的所有子节点执行相同的操作
                }
            }
        }
    
        private void toolText_TextChanged(object sender, EventArgs e)
        {
            toolbtnSearch_Click(sender, e); // 当搜索框文本内容发生变化时,执行toolbtnSearch_Click方法
        }
    
        //节点的选中取消事件
        private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Checked) // 如果当前节点被选中,则将其所有子节点的选中状态设置为true
            {
               setChildNodeCheckedState(e.Node, true);
            }
            else // 如果当前节点未选中,则将其所有子节点的选中状态设置为false
            {
                setChildNodeCheckedState(e.Node,  false);
            }
        }
    
        //选中节点之后,选中节点的所有子节点
        private void setChildNodeCheckedState(TreeNode currNode, bool state)
        {
            TreeNodeCollection nodes = currNode.Nodes;
            if (nodes.Count > 0)
                foreach (TreeNode tn in nodes)
                {
    
                    tn.Checked = state; // 将当前子节点的选中状态设置为指定的状态
                    setChildNodeCheckedState(tn, state); // 递归调用setChildNodeCheckedState方法,对当前子节点的所有子节点执行相同的操作
                }
        }
    }
    }
    
    
    
    

    class1代码:

    namespace TreeView
    {
    public class XmlOperator
    {
    private string filepath; //文件路径
    public const string xmlContent = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><Menu><Item Title="所有"><![CDATA[root]]></Item></Menu>";
    public string Filepath
    {
    get { return filepath; }
    set { filepath = value; }
    }
    private string filename; //Xml文件名
    public string Filename
        {
            get { return filename; }
            set { filename = value; }
        }
        public XmlOperator(string filepath, string filename)
        {
            // 构造函数,用于初始化对象的属性值
            this.filepath = filepath + "\\" + filename;
            this.filename = filename;
        }
    
        public XmlNodeList GetXmlNodeList()
        {
            try
            {
                // 创建XmlDocument对象并加载指定路径的Xml文件
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(filepath);
                // 获取根节点下的所有子节点
                XmlNodeList xmlNodes = xmlDoc.DocumentElement.ChildNodes;
                return xmlNodes;
            }
            catch
            {
                // 异常处理,当Xml文件加载失败时,自动恢复到初始状态并重新加载
                MessageBox.Show("用户目录文件已损坏,自动恢复到初始状态!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                RecoverXml();
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(filepath);
                XmlNodeList xmlNodes = xmlDoc.DocumentElement.ChildNodes;
                return xmlNodes;
            }
        }
    
        public void RecoverXml()
        {
            // 创建XmlDocument对象并设置其InnerXml属性
            XmlDocument doc = new XmlDocument();
            doc.InnerXml = xmlContent;
            // 调用SaveXml方法保存XmlDocument对象到指定路径的Xml文件
            this.SaveXml(doc);
        }
    
        public void SaveXml(XmlDocument doc)
        {
            // 将XmlDocument对象保存到指定路径的Xml文件
            doc.Save(filepath);
        }
    }
    }
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(2条)

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 3月27日
  • 已采纳回答 3月26日
  • 创建了问题 3月26日

悬赏问题

  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题
  • ¥15 51单片机显示器问题
  • ¥20 关于#qt#的问题:Qt代码的移植问题
  • ¥50 求图像处理的matlab方案