The functionality of the Barcode library can be achieved with the Door library.
I've attached a simple program which shows how to add the TextChanged event to a textbox.
You should add TextBox1.Focus at the beginning of your program.
Now whenever you scan a barcode the value will appear in the textbox.
You can take this value and write it to a file with
FileWrite.