Like for the question you reference in your own, it sounds more like a programming problem. In Java, for example, you have the Java Cryptography Extension which also supports AES. You can read your file into a byte array in the memory and pass this array, along with the secret key, to the encryption methods.
As for the key, it makes sense to generate it by some random process and have it stored on a separate medium, like a USB stick. You can also enter it over the keyboard into your program, but this might be tedious if it's a reasonably secure key. A less secure but still workable way is to generate the secret key from a (reasonably secure) password you enter, e.g. by computing its hash value (SHA-1, SHA-2, MD5...).