当前位置:首页 » 数据仓库 » 怎么样改一个文件的配置
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

怎么样改一个文件的配置

发布时间: 2022-12-13 04:53:19

A. linux中怎么添加或修改配置文件

1、首先辑配置文件,添加下面的这一行 。

B. 网站数据库如何修改 config.php文件的配置问题

$db_host = "数据库地址:3306";x0dx0a// database namex0dx0a$db_name = "数据表名";x0dx0a// database usernamex0dx0a$db_user = "数据库用户名";x0dx0a// database passwordx0dx0a$db_pass = "数据库密码";x0dx0a// table prefixx0dx0a将这上面的“数据库地址”改为空间服务商给你的数据库地址,将"数据表名"改为空间服务商给你的数据库中的数据库名称,将"数据库用户名"改为空间服务商给你的数据库的的账户名称,将"数据库密码"改为空间服务商给你的数据库的账户密码。以上的数据只改“”里面的东西,“”不要去掉。然后将这个文件上传到空间根目录即可。

C. 如何修改一个配置文件

不知道你说的是什么配置文件,WIN里面觉的.ini文件吗?或者.cfg之类的文件。。甚至.xml?
不过没关系,绝大多数的文件,都可以直接通过记事本打开来改。你试试。

D. 如何修改sql server 的配置文件

SQL Server 2012
其他版本

SQL Server 安装程序提供了基于系统默认值和运行时输入生成配置文件的功能。 可以使用配置文件在整个企业中部署具有相同配置的 SQL Server。 通过创建一个启动 Setup.exe 的批处理文件,还可以使企业范围内的手动安装得以标准化。
安装程序仅支持通过命令提示符使用配置文件。 下面列出了在使用配置文件时参数的处理顺序:
配置文件覆盖包中的默认值
命令行的值覆盖配置文件中的值
配置文件可以用来跟踪每个安装的参数和值。 这使得配置文件适合用于对安装进行验证和审核。

配置文件结构

ConfigurationFile.ini 文件是一个文本文件,其中具有参数(名称/值对)和描述性注释。
如何生成配置文件
插入 SQL Server 安装介质, 然后双击根文件夹中的 Setup.exe。 若要从网络共享进行安装,请找到共享中的根文件夹,然后双击 Setup.exe。
按照向导操作,直到出现“准备安装”页。 配置文件的路径是在“准备安装”页的配置文件路径部分中指定的。 有关如何安装 SQL Server 的详细信息,请参阅使用安装向导安装 SQL Server 2012(安装程序)。
取消安装并且不要真正完成安装,以便生成 INI 文件。
如何使用配置文件安装独立的 SQL Server 实例
通过命令提示符运行安装,然后使用 ConfigurationFile 参数提供 ConfigurationFile.ini 文件。
如何使用配置文件准备和完成独立 SQL Server 实例的映像 (SysPrep)
准备一个或多个 SQL Server 实例并在同一计算机上配置它们。
从安装中心的“高级”页运行“SQL Server 的独立实例的映像准备”,并捕获准备映像配置文件。
将同一个准备映像配置文件用作准备 SQL Server 的多个实例的模板。
从安装中心的“高级”页运行“SQL Server 的已准备独立实例的映像完成”,以便在计算机上配置准备的实例。
使用 Windows SysPrep 工具准备操作系统的映像,包括未配置的、已准备的 SQL Server 实例。
从安装中心的“高级”页运行“SQL Server 的独立实例的映像准备”,并捕获准备映像配置文件。
从安装中心的“高级”页运行“SQL Server 的已准备独立实例的映像完成”,但在捕获完全的配置文件之后,在“已准备好完成”页上取消它。
可以将完全的映像配置文件随 Windows 映像一起存储,以便自动执行已准备实例的配置。

E. 配置文件在哪里修改,怎么生效

无需重新启动计算机,修改完成后可以保存生效。

修改方法:

1、打开“开始”菜单,点击“所有程序”,找到“附件”中的“记事本”。

F. win7中怎么把TXT文件后缀改成配置设置文件

举例说明:
比如一个文件叫:
nihao.txt或者就叫nihao,没有后面的.txt
(打开我的电脑-工具-文件夹选项-查看-去掉隐藏文件扩展名的勾就会出现.txt了)
这个".txt"就是文件的后缀名,你将它改为".cmf"就行了`
具体步骤:
右键单击"nihao.txt"文件,选择"重命名".
然后将"nihao.txt"直接改为"nihao.cmf"

G. 如何修改配置文件

1. 引言
OpenWRT中采用LuCI作为它的Web interface界面框架,采用Lua语言。在本文中将以一个简单的示例详细描述如何自定义开发一个界面,对一个配置文件进行操作。
2.Model与Controler
MVC的设计理念是进行LuCI开发的一个关键
在LuCI中Controller的文件定义在固件中的/usr/lib/lua/luci/controller目录中,模版目录在/usr/lib/lua/luci/view目录下,而model则是在/usr/lib/lua/luci/model中。而model中有一个特殊的模块叫做CBI,被称为LuCI中最酷的功能,该模块的功能是方便的对一个配置文件进行修改。
3.示例
本文中的页面建立在LuCI界面的network下,不单独创建页面,因此无需写view,只用些controller和model就可以了。
1)首先创建一个controller
ccontroller/mycbi.lua
mole("LUCI.controller.mycbi", package.seeall)

function index()
entry({"admin", "network", "mycbi_change"}, cbi("mycbi-model/mycbimole"), "Change My Conf", 30).dependent=false
end

解释一下关键代码:

在index()函数中,使用entry函数来完成每个模块函数的注册,官方说明文档如下:
entry(path, target, title=nil, order=nil)
path is a table that describes the position in the dispatching tree: For example a path of {"foo", "bar", "baz"} would insert your node in foo.bar.baz.
target describes the action that will be taken when a user requests the node. There are several predefined ones of which the 3 most important (call, template, cbi) are described later on on this page
title defines the title that will be visible to the user in the menu (optional)
order is a number with which nodes on the same level will be sorted in the menu (optional)
其中target主要分为三类:call,template和cbi。call用来调用函数,template用来调用已有的htm模版,而CBI模块则是使用非常频繁也非常方便的模块,包含的一系列lua文件构成界面元素的组合,所有cbi模块中的控件都需要写在luci.cbi.Map中,在cbi模块中定义各种控件,Luci系统会自动执行大部分处理工作。在cbi.lua文件中封装了所有的控件元素,例如复选框,下拉列表等。

2)创建model
#mkdir /usr/lib/lua/luci/model/cbi/mycbi-model
#vim /usr/lib/lua/luci/model/cbi/mycbi-model/mycbimole.lua
m = Map("mycbi", "mycbi conf change interface")
s = m:section(TypedSection, "MySection")
s.addremove = true
s:option(Value, "username", "Name:")
key=s:option(Value, "password", "Password")
key.password=true;
return m

解释一下关键代码:

3)创建配置文件
#vim /etc/config/mycbi
config 'MySection' 'mycbi'

option 'username' 'youruser'
option 'password' 'yourpass'

4. 测试
进入OpenWRT界面,登陆后就可以点击“网络”,如果是英文就点击network,可以看到我们添加的子页面入口:

点击后进入页面如下:

输入用户名密码:root/test,点击保存,后台查看配置文件已经被更改:

5. 问题记录
1)首先,配置文件不能有任何后缀,否则页面加载后是空页面
2)如果出现500 错误,说明lua文件写的有问题,要么是路径错误,要么是语法错误,暂时没找到写日志的方法,可以用wireshark抓包看错误

H. php如何修改文件中的配置信息~呢

对形如config.php文件的读取,修改等操作的代码,需要的朋友可以参考下

复制代码代码如下:

<?php
$name="admin";//kkkk
$bb='234';
$db=4561321;
$kkk="admin";
?>

函数定义:
配置文件数据值获取:function getconfig($file, $ini, $type="string")
配置文件数据项更新:function updateconfig($file, $ini, $value,$type="string")
调用方式:

复制代码代码如下:

getconfig("./2.php", "bb");//
updateconfig("./2.php", "kkk", "admin");

复制代码代码如下:

<?php

//配置文件数据值获取。
//默认没有第三个参数时,按照字符串读取提取''中或""中的内容
//如果有第三个参数时为int时按照数字int处理。
function getconfig($file, $ini, $type="string")
{
if ($type=="int")
{
$str = file_get_contents($file);
$config = preg_match("/" . $ini . "=(.*);/", $str, $res);
Return $res[1];
}
else
{
$str = file_get_contents($file);
$config = preg_match("/" . $ini . "=\"(.*)\";/", $str, $res);
if($res[1]==null)
{
$config = preg_match("/" . $ini . "='(.*)';/", $str, $res);
}
Return $res[1];
}
}

//配置文件数据项更新
//默认没有第四个参数时,按照字符串读取提取''中或""中的内容
//如果有第四个参数时为int时按照数字int处理。
function updateconfig($file, $ini, $value,$type="string")
{
$str = file_get_contents($file);
$str2="";
if($type=="int")
{
$str2 = preg_replace("/" . $ini . "=(.*);/", $ini . "=" . $value . ";", $str);
}
else
{
$str2 = preg_replace("/" . $ini . "=(.*);/", $ini . "=\"" . $value . "\";",$str);
}
file_put_contents($file, $str2);
}

//echo getconfig("./2.php", "bb", "string");
getconfig("./2.php", "bb");//
updateconfig("./2.php", "kkk", "admin");
//echo "<br/>".getconfig("./2.php", "name","string");

?>

复制代码代码如下:

//完善改进版

/**
* 配置文件操作(查询了与修改)
* 默认没有第三个参数时,按照字符串读取提取''中或""中的内容
* 如果有第三个参数时为int时按照数字int处理。
*调用demo
$name="admin";//kkkk
$bb='234';

$bb=getconfig("./2.php", "bb", "string");
updateconfig("./2.php", "name", "admin");
*/
function get_config($file, $ini, $type="string"){
if(!file_exists($file)) return false;
$str = file_get_contents($file);
if ($type=="int"){
$config = preg_match("/".preg_quote($ini)."=(.*);/", $str, $res);
return $res[1];
}
else{
$config = preg_match("/".preg_quote($ini)."=\"(.*)\";/", $str, $res);
if($res[1]==null){
$config = preg_match("/".preg_quote($ini)."='(.*)';/", $str, $res);
}
return $res[1];
}
}

function update_config($file, $ini, $value,$type="string"){
if(!file_exists($file)) return false;
$str = file_get_contents($file);
$str2="";
if($type=="int"){
$str2 = preg_replace("/".preg_quote($ini)."=(.*);/", $ini."=".$value.";",$str);
}
else{
$str2 = preg_replace("/".preg_quote($ini)."=(.*);/",$ini."=\"".$value."\";",$str);
}
file_put_contents($file, $str2);
}

I. 如何修改一个配置文件

右击打开方式---选择记事本打开,就可以修改了

J. 如何修改一个配置文件

1、右键点击文件夹 - 属性 - 安全 - 编辑 ; 2、点击不允许查看文件夹的用户名,在这个用户名的权限拒绝下打勾,再点击:应用 - 确定。