From: Claire on
Hello,
I came across the following problem.
After compiling my app into executable I want to insert into it some data
(few bytes), probably at the end of the file.
How can I programmatically read those bytes from within the same code?
Your help appreciated,
Claire


From: Dee Earley on
On 21/05/2010 03:45, Claire wrote:
> Hello,
> I came across the following problem.
> After compiling my app into executable I want to insert into it some data
> (few bytes), probably at the end of the file.
> How can I programmatically read those bytes from within the same code?

You can use a resource file with a known marker in that you replace, and
can be read easily in your app using LoadResData() or append to the end
of the executable (data on the end won't effect the exe) and read it
using normal file I/O.

The resource method means you have an upper/fixed limit on size, but it
depends on the data itself as to whether that will be a problem or not.

--
Dee Earley (dee.earley(a)icode.co.uk)
i-Catcher Development Team

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)
From: Tony Toews [MVP] on
"Claire" <replyto(a)fra> wrote:

> I came across the following problem.
>After compiling my app into executable I want to insert into it some data
>(few bytes), probably at the end of the file.
>How can I programmatically read those bytes from within the same code?
>Your help appreciated,

I wonder though if anti virus programs would regard that as suspicious
behavior.

BTW are you trying to add a license key routine? I just give the
users a nine digit number. I create a file with that name and their
name encrypted in the file. I upload that to my website. Then my
program then downloads that file with the nine digit number from my
website.

Quite painless I hope. <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
From: mscir on
On 5/21/2010 1:57 PM, Tony Toews [MVP] wrote:
>...I just give the users a nine digit number.
>...I create a file with that name and their name encrypted in the
file.
>...I upload that to my website. Then my program then downloads that file
>...with the nine digit number from my website.

That seems like a great approach. Do you use a hash for the encryption?

--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Henning on

"Claire" <replyto(a)fra> skrev i meddelandet
news:e0qF0%23I%23KHA.5476(a)TK2MSFTNGP06.phx.gbl...
> Hello,
> I came across the following problem.
> After compiling my app into executable I want to insert into it some data
> (few bytes), probably at the end of the file.
> How can I programmatically read those bytes from within the same code?
> Your help appreciated,
> Claire
>

It could be possible to declare a string Const, and finding it's value and
change it.
Public Const MyCode As String = "asdfghjkl". Be aware it is stored as
Unicode.

/Henning