?
Solved

Parse INI file in memorry

Posted on 2003-11-27
15
Medium Priority
?
445 Views
Last Modified: 2008-03-17
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
Comment
Question by:patilvinayak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
15 Comments
 
LVL 27

Expert Comment

by:Dabas
ID: 9831363
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
 
LVL 2

Expert Comment

by:MaxPol
ID: 9831954
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
 

Author Comment

by:patilvinayak
ID: 9832970
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 27

Expert Comment

by:Dabas
ID: 9833205
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
 

Author Comment

by:patilvinayak
ID: 9833517
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
 
LVL 27

Expert Comment

by:Dabas
ID: 9833548
patilvinayak:
Have a look at http://www.superspeed.com/ramdisk.html

Dabas
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9833569
0
 
LVL 2

Expert Comment

by:rekhasri
ID: 9835359
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
 
LVL 27

Expert Comment

by:Dabas
ID: 10162294
Dan:
I care.
Suggest points to Dabas

Dabas
0
 
LVL 27

Expert Comment

by:Dabas
ID: 10590606
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
 

Author Comment

by:patilvinayak
ID: 10591410
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
 
LVL 27

Expert Comment

by:Dabas
ID: 10591513
Moderator:
PAQ - Refund.

Dabas
0
 

Accepted Solution

by:
amp072397 earned 0 total points
ID: 10618976
PAQed, with points refunded (125)

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question