ini

How to encrypt a value in ini file

痞子三分冷 提交于 2019-12-05 18:51:55
What is the best way to encrypt a value in INI file? Using Encryption/Decryption key?? For what purpose? Security? If you are trying to (e.g.) encrypt a plaintext password you should probably use some implementation of PKI. Remember though, that then key management becomes your problem. Just encrypting the value is not a panacea because the ini file is most likely on the local host's file system, presumably the same place you'll have to store your key pair. You've simply abstracted the problem down a layer. They won't be able to read your encrypted password directly, but if they can find the

Delphi inifiles ReadDateTime

末鹿安然 提交于 2019-12-05 17:33:20
The essence in the following: procedure TForm1.Button1Click(Sender: TObject); var cfile: TInifile; Date1: TDateTime; begin Date1 := IncYear(Now, -50); cfile := TInifile.Create(ExtractFilePath(Application.ExeName) + 'Settings.ini'); try cfile.WriteDateTime('Main', 'DateTime', Date1); ShowMessage('Recorded in the ini file ' + DateTimeToStr(Date1)); Date1 := cfile.ReadDateTime('Main', 'DateTime', Now); ShowMessage('Read from ini file ' + DateTimeToStr(Date1)); finally cfile.Free; end; end; Entry in the ini file passes without problems. In the file is written to 04-Dec-63 17:28:14. Read also from

Is “login.ini” a reserved name?

家住魔仙堡 提交于 2019-12-05 16:59:48
I store the MRU of logins to my application in a file called login.ini and I save it in widnows application folders. I noticed that on some systems — I don't know why; I cannot find a common cause — the user cannot create the file, whereas it creates all other files in the same folder. The only reason I can think of is that some antivirus/windows setting/... doesn't allow this particular user to create the file on this system. I solved the problem by renaming the file and it seems ok, but I'd like to be sure. Does anyone know more? Note for bounty: This is a related question I asked that

From where is my php.ini being loaded?

不问归期 提交于 2019-12-05 11:09:53
I am running this Docker instance of a linux debian:jessie with php 5.6. This is part of my phpinfo : As we can see the php.ini should be located at /usr/local/etc/php And this is what I have inside /usr/local/etc/ But there is no php.ini inside it. I the other hand, I have the php.ini inside So, from where exactly is my php.ini being loaded? We dont even have a php process running but the php seems to be ok - being displayed phpinfo in the screen. Let try it as an answer: It does not exist at all, which means php will run the default options. Look at your docker file, it starts from a "clean"

Reading path from ini file, backslash escape character disappearing?

断了今生、忘了曾经 提交于 2019-12-05 09:50:05
I'm reading in an absolute pathname from an ini file and storing the pathname as a String value in my program. However, when I do this, the value that gets stored somehow seems to be losing the backslash so that the path just comes out one big jumbled mess? For example, the ini file would have key, value of: key=C:\folder\folder2\filename.extension and the value that gets stored is coming out as C:folderfolder2filename.extension . Would anyone know how to escape the keys before it gets read in? Let's also assume that changing the values of the ini file is not an alternative because it's not a

PowerShell to Read single value from simple .ini file

大憨熊 提交于 2019-12-05 08:24:35
Everything I've found looks way over complex. It's almost like I just need to read a text file. ADAP.ini contains this, nothing else: http://xxx.104.xxx.226 APP=2.3.6 DLL=2.3.6 Using Powershell, how can I read what APP=value is? and or what DLL=value is? I would store the value in a variable and use it later in Powershell script. This looks like a good use case for ConvertFrom-StringData which by default looks for key value pairs separated by the equals symbol. Because the first line of your .ini file doesn't have an equals we would need to skip it to avoid an error. This can be done simply

reading classical ini file on iPhone

丶灬走出姿态 提交于 2019-12-05 04:59:30
问题 does anybody knows how to parse an ini file ? I guess I need a regular expression or something. I have only this pattern in the file : varName=value; Thanks a lot ! update : here you go : https://github.com/DrMoriarty/MetroEditor/tree/master/MetroEditor/ini 回答1: There's an INI file parser written in objective C available here - either use it directly, or read the source to pick up a few tips. EDIT: as that link appears dead, try this alternative - thanks mc007 来源: https://stackoverflow.com

c++ GetPrivateProfileString read ini file from current directory

你离开我真会死。 提交于 2019-12-05 04:56:32
I'm creating a dll on c++. It is a Visual Studio project. The dll reads some data from ini file. I have decided to use GetPrivateProfileString function. It works almost completely. It does not see file in current directory. How can I provide this parameter (variable called path)? How can I pass last parameter (path) Code: LPCTSTR path = L"\\test.ini"; TCHAR protocolChar[32]; int a = GetPrivateProfileString(_T("Connection"), _T("Protocol"), _T(""), protocolChar, 32, path); String from test.ini: [Connection] Protocol = HTTP I also tried this: LPCTSTR path = L"test.ini"; But it did not help me

What's the purpose of ini_set() in php? (especially for error reporting)

ぐ巨炮叔叔 提交于 2019-12-05 01:10:10
问题 Ok so PHP has the function ini_set() which a lot of people are aware of and will use to set various configuration options (here) to help with development etc. However, this function does only seem to work at runtime and will not work if there are any fatal errors or the script has syntax errors and can't be parsed / compiled. Therefore surely there is no point of doing this (from the manual): http://php.net/manual/en/function.ini-set.php Examples Example #1 Setting an ini option <?php echo

.ini file load environment variable

你离开我真会死。 提交于 2019-12-05 00:11:08
I am using Alembic for migrations implementation in a Flask project. There is a alembic.ini file where the database configs must be specified: sqlalchemy.url = driver://user:password@host/dbname Is there a way to specify the parameters from the environment variables? I've tried to load them in this way $(env_var) but with no success. Thanks! I've solved the problem by setting sqlalchemy.url in env.py as @dirn suggested. config.set_main_option('sqlalchemy.url', <db_uri>) did the trick, where <db_uri> can be loaded from environment or config file. I was looking for a while how to manage this for