Implementing a project with VB Script. I'm stuck. Can someone help me?
I've applied for an IT specialist training program for application development and now have a trial project to work on. Unfortunately, I'm stuck, and after trying almost everything else, I'm looking for help here. Here's my task:
"Create a program that writes a fixed number of random numbers to a file.
Create the program as a VB script.
The random numbers should be written to the file as binary data . The program should initially request user input regarding how many bytes of random numbers should be written to the file. The name and location of the file should be stored as a constant in the program.
Check the contents of the file created by the program with a hexadecimal editor . Make sure the numbers were written to the file as binary data, not text. The individual bytes in the file must contain random values in the range 0x00 to 0xFF.
To check, count the number of occurrences of each value in the created file by extending your program.
For a random number file with 100,000 bytes, each byte should occur on average about 390 times.
Output a list of values and their counts to a separate text file."
I have already tried to find out more and have also downloaded a hexadecimal editor (HxD).
If anyone knows the best way to proceed or can help me with this task, that would be a great relief. Unfortunately, I really don't know what to do next.
Many thanks in advance!
I have no idea why anyone today is still relying on VBScript.
The language has not been further developed since 2009 and is being shortened completely disappear from the system . To use them today is bordered by morgue!
…you can look a long way
Classic VBScript is only capable with a lot of trickery/use.
VBScript does not know bytearray or binary files! You can work with "remote objects" like ADODB.Stream, which naturally presupposes that these are also present in the system.
For emergency, a string can be used as a container for individual bytes/charas. fill these with the desired number of random ASCII characters from 0 to 255 and then write them into a file.
…so I'll whistle the body…
create_random_bin_file.vbs
Sorry, I don’t know why VBScript was taken. However, I can also complain badly, this is supposed to be a test task, and it is tested under other conditions how strongly my problem-solving capacity is marked. Thank you for your answer, you have helped me so far. Excuse me for the inconvenience and thank you again!
The first step would be Documentation to look over. At Visual Basic you even have the luxury that this is available in German.
In itself, the procedure is very simple. First, of course, it is necessary to read how many random numbers are to be generated. On the basis of the number read in, I would like to Array Type byte create with the given capacity. Well, I’d be in one For loop (here apparently called ‘For…Next’) the array with Random figures fill. In the next step, of course, the generated random numbers written to the file ,. That was already and as you can see, you can find everything in documentation or Google search.
Supplement: Since you’ve noticed that you’ve never worked with Visual Basic, you should also look at how to create an application at all (must make sure you choose not C# but Visual Basic).
However, it is necessary to note that bizarre mentions Visual Basic really is no longer timely and even if it is a test task it is not much sense to use Visual Basic.
lg Suiram1
As I said, I don’t know what the employer was thinking about, but still thank you
that should be VBScript and not VB.Net that is a huge difference. VBScript does not know any data types and does not even know an array of type Byte
Thanks for the hint.