LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write ini file not readable

Hi all,

 

I store configuration data in an ini file and give this file a custom extension.

 

If users open this file in a text editor I don't want it to be readable.  Without encrypting the text how can I do this?

 

I cant seem to get the binary VIs to work.  Maybe somebody could show me?

 

Cheers,

 

Battler.

0 Kudos
Message 1 of 11
(5,015 Views)
save the values as variant which couldnt be readable by user in notepad, see the attached file which cannot be read by user,
Message 2 of 11
(5,006 Views)
0 Kudos
Message 3 of 11
(5,005 Views)

Nice suggestion Kode.

 

As variant it is still readable, though annoying to read.

 

Any other suggestions?

0 Kudos
Message 4 of 11
(4,966 Views)

You haven't really defined how secure you want your data, but if you just want a simple way to hide the information from a casual user, this may work.

 

scramble data.png

 

Obviously, if someone really wanted to, they could figure this out.

 

steve 

 

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Download All
0 Kudos
Message 5 of 11
(4,961 Views)

What do you mean with "not readable"? Do you want the data to be encripted? How unconfortable shall reading data for human be?

 

Working with binary files should not be difficult. I would put all configuration data into one cluster, wire it to data input of the Write to Binary.VI  and store it to the given file. However if you have strings with your configuration data it will be readable in a plain text editor. 

0 Kudos
Message 6 of 11
(4,939 Views)

Hello battler,

 

Have you considered using the Datalog VIs?  You can find them here:

 

Block Diagram, Programming>>File I/O>>Advanced File Functions>>Datalog

 

The Datalog file is great for storing configuration data for your program.  It is a binary file so you will not be able to open it in notepad and it stores clusters as records.  Simply reading a different record entry from the file will load a different configuration.

0 Kudos
Message 7 of 11
(4,888 Views)

Nice one.  So I can use Datalog instead of ini.  I'lll try it and let you know.

 

Cheers,

 

Battler.

0 Kudos
Message 8 of 11
(4,842 Views)

The problem with datalog is it is dependent on the data type we use to create it. Suppose we create a datalog file with data type of a cluster containing a string and numeric and we wrote all the config data as clusters and stored it in a datalog file, it would be impossible for anyone to open the file without the labview program.    BUT suppose in future if the config data had to incude an enum data within the cluster, the previous datalog file would be useless. We will have to create a new datalog file with the new cluster from scratch.

 

0 Kudos
Message 9 of 11
(3,362 Views)

It's a strange request to me because the ONLY reason I would choose an ini file is so people can easily read it!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 11
(3,348 Views)