Home > Software engineering >  Real-time access to a program of data
Real-time access to a program of data

Time:09-30

Dear god,
I want to ask what was the thinking of a technical problem? The situation is:
(I have a company test procedure is to purchase hardware + software), each time the test interface will generate the test data, for example: the voltage current value, etc., at the same time also can produce the data backup, TXT documents (format is unified), 1 time per test, TXT update in time,
Now want to ask, how to use VB real-time access to every one of the software test data? Need real time,
If it is inter-process communication mechanism, the change?
Now don't know whether the program open,

CodePudding user response:

Assume that the program is a.e xe, data file is a.t xt,
Build a batch file a.c md, start the program with a.c md, will put the last a.t xt made a backup the current time,
[code=TXT] REM time Spaces (for example, only one hour) in the replacement of 0
Time: SET now=%=0%

There were only eight characters before REM (removed after the second decimal)
Now SET now=% : % ~ 0, 8

REM to remove the colon
SET now=% now: : %=

REM and date yyyy - mm - ddTHH: mm: SS format
SET the date now=% % % T % now

REM with current date/time backup file
Now COPY a.t xt a_ % %. TXT

REM to remove variable
The SET now=

REM caller
A.e xe
[/code]

CodePudding user response:

Thank you offer ideas upstairs!
But I want to directly through the interprocess communication mechanism or other ways, such as hook to get, so if you can get?

CodePudding user response:

Reserved interface protocols that should see whether testing software, if there is, according to the technical manuals do,

If not, the direct access to TXT file is the most simple way,

In addition, you want to use a hook? What news?

CodePudding user response:

Monitor if the file has been modified,

CodePudding user response:

Use the API ReadDirectoryChangesW

MSDN98_1. ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2. ISO http://pan.baidu.com/s/1bnGo0Vl
Download and install MSDN98

Reference MSDN98 \ SAMPLES \ VC98 \ SDK \ WINBASE \ IO \ FWATCH \ *. *


CodePudding user response:

Monitor if the file is modified is a kind of way, and also can HOOK, if written to the file using a API, HOOK and then take the data line directly, also can find his assembly such as cracking of the file to write some code
  •  Tags:  
  • API
  • Related