Link to home
Start Free TrialLog in
Avatar of patilvinayak
patilvinayak

asked on

Parse INI file in memorry

I am writingg a program which sends delivery note details to another location (INI or XML format).

I do not want someone to be able to read it. So I encrypt the file Now at other end its decrypted again to get orriginal form. After decrypting the file it lies in string format in the memorry. Due to security reason after decrypting file I do not want to store in file system (HDD), and want to parse it in the memory itself.

most of the API functions require ffile name as an argument to read (parse) data from INI or XML file.

Can anyone suggest me any way to parse string directly rather than storing in Disk or redirect me to any webpage containing such solution.

Or if you have any idea to achieve the ffunctionality by other way.

thanks in advance.

Or you have got any good
Avatar of Dabas
Dabas
Flag of Australia image

Hi patilvinayak:
What about using a connectionless ADO recordset?
Instead of using an ini or an XML, store the data in a memory table


Dabas
Avatar of MaxPol
MaxPol

Hi,

my question is:

if you have already that data in memory after the decryption process, while you could not use it directly by the other application?

If for istance your decryption app, will then run another app that require these info, you could easily pass them as a command line, or comunicate to the other app via DDE.

Bye,

Max
Avatar of patilvinayak

ASKER

Hi,

ACtually there are 2 applications running at two remote locations and data is sent from one location to another by email. At both side applications use database and send data between each other.

At destination application imports the data from INI/XML file sent by first application. Now as already stated data is secure so it should not be readable to human. Only application should be able to read and import into its own database.

Encryption / decryption technique is already developed and reading / writing  INI file technique is already done.

Problem arises at destination application. When after reaches there it is in encrypted format, so it is decrypted by application but before reading individual data elements from INI file it should be stored on file system.

Because all INI file reading functions read from file and not from memory string directly, application cannot import data from it.

I hope this clarifies the question.

Following is standard function to read from INI file. It accepts filename as argument, I want to pass STRING instead. Thats it !!


nReturned% = GetPrivateProfileString(Header$, INI_Param$, "Invalid", cBuffer$, Len(cBuffer$), FILE NAME)

patilvinayak:
In the old pre-Windows days there was something called "Virtual Drive" or RAM DISK
This actually simulated a HDD in memory.
A command in the system file config.sys created this.
If the decrypting system's operating system is Windows ME or below, then this is still an option.
I am not sure about XP though. Maybe also.
If this would solve your problem, then I can investigate further for you

Dabas
If virtual drive or RAM DISK can work on 98/2000/NT/XP then only it is possible to use it. Otherwise no use.
Anyway thanks for suggestion.
patilvinayak:
Have a look at http://www.superspeed.com/ramdisk.html

Dabas
hi,

i am not very sure abt what u r asking bcause i dont know much abt using ini files..

from what i understand, ur application decrypts a XML to a well-formed XML String.

but if u have an XML string, u can very well, manipulate it without storing it as a file.

if u use MSXML3, u can create a DOMDocument and load it from a string using the method loadXML(string)..

am i making a stupid suggestion after understanding all this wrongly or am i right? let me know.
Dan:
I care.
Suggest points to Dabas

Dabas
Moderator:

I do not take offence with Dan disagreeing with me. We often do not see eye to eye, and I hope that I have not offended him either.
I still feel that my solution is as good as any other.

Dabas
Frankly speaking none of the comments added to this forum satisfied me.

The problem which I face is not parsing of the INI file, but I do not want to store that file on harddisk for security reasons.

Ramdisk may be solution if It could work on all Win OS, secondly, the product we are developing is ready to install product. It is not for specific one client. It is no way useful.

As far as XML Dom is concern, I perfectly understood what --rekhasri-- wanted to say, but I need more concrete answer not just idea. Again I am not sure how much it will be useful.

If I have to give points, I expect more concrete answer so it will be atleast useful in nearer ffuture.

Meanwhile I have completed developement with storing the INI files on the harddisk. The product will modify when concrete solution will be found to parse it in memory.

Patilvinayak
Moderator:
PAQ - Refund.

Dabas
ASKER CERTIFIED SOLUTION
Avatar of amp072397
amp072397

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial