Solved

Parse INI file in memorry

Posted on 2003-11-27
15
438 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 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