Solved

Parse INI file in memorry

Posted on 2003-11-27
15
423 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
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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now