Common/SkyComm.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Data;
using System.Collections;
using System.Net;
using System.Threading;


namespace FXPDFToImage
{
    public class SkyComm
    {
        public static void SetValue(string appkey,string value)
        {
              string filename = Application.StartupPath + "\\system.config";
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.Load(filename);
            //得到顶层节点列表 
            XmlNodeList topM = xmldoc.DocumentElement.ChildNodes;
            foreach (XmlElement element in topM)
            {
                if (element.Name.ToLower() == "appsettings")
                {
                    //得到该节点的子节点 
                    XmlNodeList nodelist = element.ChildNodes;
                    if (nodelist.Count > 0)
                    {
                        try
                        {
                            for (int i = 0; i < nodelist.Count; i++)
                            {
                                try
                                {
                                    XmlElement el = nodelist[i] as XmlElement;
                                    if (el!=null && el.Attributes["key"].Value == appkey)
                                    {
                                         el.Attributes["value"].Value=value;
                                         xmldoc.Save(filename);
                                        break;
                                    }
                                }
                                catch (Exception)
                                {
                                    continue;
                                }
                            }
                        }
                        catch (Exception)
                        {
                            continue;
                        }
                    }
                }
            }
        }
        
后面还有 45 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。