[SOLVED] Programatically extract text from a .NET app's GUI ? - Overclock.net - An Overclocking Community

Forum Jump: 

[SOLVED] Programatically extract text from a .NET app's GUI ?

 
Thread Tools
post #1 of 6 (permalink) Old 10-16-2016, 07:29 AM - Thread Starter
New to Overclock.net
 
takoma's Avatar
 
Join Date: Sep 2016
Posts: 29
Rep: 0
Hi all,

I've been asked to do the very tedious task of extracting information out of old binary files. Those files are datapoints collected from sensors and include things like timestamp, coordinates, events...
The files are encoded in a custom and poorly documented format that is soon to be phased out. The only way I can get the info I need out of those files is by using a .NET app that has very little features and of which I don't have the source code. Basically, the app allows me to read a file and display the content in textboxes but that's it, no export, no logging...

Now, I have about 100.000 of these files to process so doing it by hand is not an option biggrin.gif. I'm short on ideas of how to automate the process though...
I don't really want to spend time coding a whole new reader because the one I have does the job fine except for a missing export feature and as I said the format is bizarre and will be abandoned after this anyway.

I'm more of a Linux guy, so I'm sure I could have figured out a way if I had access to pipes, redirections and things of that sort but my knowledge of Windows platforms is too limited to come up with a solution. Thanks for your help in advance smile.gif

takoma is offline  
Sponsored Links
Advertisement
 
post #2 of 6 (permalink) Old 10-16-2016, 01:42 PM
Old dog, old tricks
 
ronnin426850's Avatar
 
Join Date: Sep 2009
Location: Europe
Posts: 9,738
Rep: 574 (Unique: 474)
I am certain there was a library specifically for that somewhere on the internet. Google deeper, you may find it.
ronnin426850 is offline  
post #3 of 6 (permalink) Old 10-18-2016, 12:00 AM
New to Overclock.net
 
Join Date: Jul 2009
Location: Perth, WA
Posts: 106
Rep: 8 (Unique: 8)
Don't suppose it's possible to post one up as a sample so I know what you're working with? Might not be as hard as you think to write something to read the files properly

As an alternative, if you can pop up a textbox with the content you want, then something quick and dirty like AHK would work easily enough. It has window detection, so you could set it to trigger whenever a window with certain parameters is opened.

Big lez is love
cheers.gifAUSSIE OCN CLUBcheers.gif
S0ULphIRE is offline  
Sponsored Links
Advertisement
 
post #4 of 6 (permalink) Old 10-19-2016, 02:27 PM - Thread Starter
New to Overclock.net
 
takoma's Avatar
 
Join Date: Sep 2016
Posts: 29
Rep: 0
Quote:
Originally Posted by S0ULphIRE View Post

As an alternative, if you can pop up a textbox with the content you want, then something quick and dirty like AHK would work easily enough. It has window detection, so you could set it to trigger whenever a window with certain parameters is opened.

Yeah, you are correct. I installed AHK and was kind of amazed by all the things you can do with it.
I wrote a script to barf up all my text fields in a csv in less than 2H and I learned a few things so I would consider this a very positive experience smile.gif

Thanks for the tip thumb.gif

takoma is offline  
post #5 of 6 (permalink) Old 10-19-2016, 05:55 PM
New to Overclock.net
 
Join Date: Jul 2009
Location: Perth, WA
Posts: 106
Rep: 8 (Unique: 8)
No worries! I use AHK for a myriad of stuff at work ranging from quick text shortcuts to a pop-up nyan cat that tells me when the next bus is leaving from the stop outside my work tongue.gif I feel dirty every time I resort to using it haha, but it works and it's incredibly easy so I'll continue singing its praises biggrin.gif

Big lez is love
cheers.gifAUSSIE OCN CLUBcheers.gif
S0ULphIRE is offline  
post #6 of 6 (permalink) Old 10-21-2016, 08:37 AM
New to Overclock.net
 
Mrzev's Avatar
 
Join Date: Feb 2008
Location: Texas
Posts: 2,258
Rep: 96 (Unique: 76)
If the app uses WPF. you might be able to connect directly to the objects. There are some debugger tools that can help with that.

Another option is to write some code that clicks trough the data by position clicks, and takes screenshots of the data, then you would run it trough an OCR.



Mrzev is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off