[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 455
  • Last Modified:

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
0
patilvinayak
Asked:
patilvinayak
1 Solution
 
DabasCommented:
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
0
 
MaxPolCommented:
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
0
 
patilvinayakAuthor Commented:
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)

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
DabasCommented:
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
0
 
patilvinayakAuthor Commented:
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.
0
 
DabasCommented:
patilvinayak:
Have a look at http://www.superspeed.com/ramdisk.html

Dabas
0
 
rekhasriCommented:
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.
0
 
DabasCommented:
Dan:
I care.
Suggest points to Dabas

Dabas
0
 
DabasCommented:
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
0
 
patilvinayakAuthor Commented:
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
0
 
DabasCommented:
Moderator:
PAQ - Refund.

Dabas
0
 
amp072397Commented:
PAQed, with points refunded (125)

Thanks very much!
amp, ee admin, amp*at*experts-exchange.com
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now