configuration-files

Parse config file of unknown length

安稳与你 提交于 2020-01-15 12:15:28
问题 I am a python noob that has hit a bit of a snag. I need to import a config file to make a program work. I am using the configparser of course but here is the problem I am having and can not figure out. My config file will look something like this [Book1] title = "Hello World" status = "in" location = "s2v14" [Book2] .... and this will continue indefinately. My problem is how do I parse the config file if I dont know what the section is or even how many sections will exist. The purpose of this

Max key/value length in 'application configuration' files

♀尐吖头ヾ 提交于 2020-01-14 13:48:30
问题 What's the maximum allowed length for MyKey and MyValue in a configuration file? <configuration> <appSettings> <add key="MyKey" value="MyValue" /> </appSettings> </configuration> 回答1: As per knowledge there is no limitation the key value pair in webconfig file ..... if you are planning to add object to config file check this post will help you to achieve your task How to store custom objects in web.config ? 来源: https://stackoverflow.com/questions/6382758/max-key-value-length-in-application

FitNesse configuration files

耗尽温柔 提交于 2020-01-13 10:29:28
问题 I'm using FitNesse as a functional testing framework. I'm running into trouble when FitNesse runs code that needs configuration. If I need to get a connection string from the configuration file, I can get it to work by adding it to the FitServer.exe.config. However, I don't like that solution. I would like FitNesse to load my own configuration file, namely TheNameOfMyApp.dll.config. Is this possible? 回答1: Sure, easy to do. I'm assuming you're using the dotnet or dotnet2 test runner. I'm using

How can I edit files in a docker container when it's down/not-started

倾然丶 夕夏残阳落幕 提交于 2020-01-13 06:32:46
问题 Use-case: I started some nice docker image and my container needs some playing around (configuration file changes for research). I edit a file (using sed or vim ;-) ) and then I stop the container and try to start it. Now I made a mistake in the configuration and the docker container does not come up when I do: docker restart <my-container-id/-name> How can I edit the configuration-file to fix the mistake? 回答1: You can uses docker cp to copy files to/from a container, whether it's running or

Use properties file instead of static final variables

回眸只為那壹抹淺笑 提交于 2020-01-12 05:01:08
问题 I have many classes with static final fields which are used as default values or config. What is best approach to create global config file? Should I move these fields to single static class, use properties file or what? Edit: I need to use this values both in java classes and xhtml pages. Values dosen't depend on envirnoment. I could compile project to set new values - no problem. 回答1: The answer depends... Put stuff in properties files if the values change depending on runtime environment

Change Microsoft Config File Encryption Method From TripleDES

自古美人都是妖i 提交于 2020-01-10 20:06:30
问题 When encrypting ("protecting") Microsoft config sections, you get something that looks like the XML below. It follows (at least partially) the W3 spec for XML Encryption. However, in the XML below you'll see that the EncryptionMethod under the EncryptedData section is "tripledes-cbc". We would like to be able to change that to a more-secure alternative, specifically AES, which is specified in the aforementioned W3 spec as well. In many calls with Microsoft's support engineers, they are

Modify config file using bash script

佐手、 提交于 2020-01-09 03:01:05
问题 I'm writing a bash script to modify a config file which contains a bunch of key/value pairs. How can I read the key and find the value and possibly modify it? 回答1: A wild stab in the dark for modifying a single value: sed -c -i "s/\($TARGET_KEY *= *\).*/\1$REPLACEMENT_VALUE/" $CONFIG_FILE assuming that the target key and replacement value don't contain any special regex characters, and that your key-value separator is "=". Note, the -c option is system dependent and you may need to omit it

How to create Application.exe.config in application directory

痞子三分冷 提交于 2020-01-06 09:04:33
问题 So I recently updated my application to support a new feature. In the past if the configuration file was deleted by the user it wasn't a big deal. This new feature requires it to exist, and one of the requirements is that, the file exists in the application's installation directory. I have notice when the file is deleted ( depending on variables I have not figured out ) I get a .NET notification that the configuration file is missing or corrupt. Currently my program then crashes ( I still

How to create Application.exe.config in application directory

[亡魂溺海] 提交于 2020-01-06 09:04:07
问题 So I recently updated my application to support a new feature. In the past if the configuration file was deleted by the user it wasn't a big deal. This new feature requires it to exist, and one of the requirements is that, the file exists in the application's installation directory. I have notice when the file is deleted ( depending on variables I have not figured out ) I get a .NET notification that the configuration file is missing or corrupt. Currently my program then crashes ( I still

VB.Net How do I read/write custom config file

左心房为你撑大大i 提交于 2020-01-06 09:02:23
问题 Environment: .Net 3.5 VB.net (C#ok too) I wrote a multi-project WinForms app that needs to load a couple dozen variables from a client section of a config file based on user's selection of client. Also some program variables need to be loaded as well. So far so good, I put them in an app.config file. In the appsettings section I put the main program variables. e.g. <appSettings> <add key="LocalServerName" value="PHILDESKTOP" /> ... and I created a ClientParameters section for the selectable