找不到config.json(找不到configini)

  • 1、运行里的CONFING打不开,提示找不到CONFIG这个文件,怎么办?
  • 2、求救!开机找不到config文件
  • 3、我怎么new不出来jsonconfig
  • 4、为什么我找不到CONFIG文件夹
  • 5、网站serverConfig.json加载失败

你可能优化过系统,设置文件被你删除了或者修改得不能使用了。

用系统修复台修复吧或者重装。再或者就把

硬盘

挂到别人的机器上,搞个相同的设置文件~

那是你没有正常关机程序没来得及保存退出。所以文件就被破坏了。你用v盘到别人的电脑上把system复制过来,在用系统盘进人dos,然后把v盘插上(我不知道你的主板能不能从v盘启动,可以的话就直接把dos复制到v盘上就行了。所以只好分开来用了)用命令copy system c:\windows\system32\config 就行了 或者你重装或恢复下系统就行了

代码:请导入 System.XML命名空间

string file = Server.MapPath(@”~\web.config”);

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.Load(file);

string s1 = “aaa”;

string s2 = “bbb”;

string h = “ccc”;

string user = “ddd”;

string pass = “eee”;

XmlNodeList nodeList = null;

nodeList = xmlDoc.SelectSingleNode(“configuration//connectionStrings”).ChildNodes;

//遍历所节点

foreach (XmlNode xn in nodeList)

{

//节点类型转换XmlElement类型

XmlElement xe = xn as XmlElement;

if (xe.Name == “add”)

{

if (xe.GetAttribute(“name”) == “acountConnectionString”)

{

xe.SetAttribute(“connectionString”, s1);

}

if (xe.GetAttribute(“name”) == “mailaddress”)

{

xe.SetAttribute(“connectionString”, s2);

}

}

}

nodeList = xmlDoc.SelectSingleNode(“configuration//system.net//mailSettings//smtp”).ChildNodes;

foreach (XmlNode xn in nodeList)

{

//节点类型转换XmlElement类型

XmlElement xe = xn as XmlElement;

if (xe.Name == “network”)

{

xe.SetAttribute(“host”, h);

xe.SetAttribute(“userName”, user);

xe.SetAttribute(“password”, pass);

break;

}

}

xmlDoc.Save(file);

显示隐藏的文件夹试试,方法:工具-文件夹选项-显示隐藏的文件夹(勾上)

网络连接失败。网站serverConfig.json对于网络的需求是非常大的,只要该网站的网络连接失败就会导致该网页加载失败,用户可以通过更换新的网络来回复该网站的加载。

原创文章,作者:MX2UM,如若转载,请注明出处:https://www.506064.com/n/127090.html

(0)
MX2UMMX2UM
上一篇 2024-10-03
下一篇 2024-10-03

相关推荐

发表回复

登录后才能评论