As each number is generated, check the current numbers array to make sure it does not already contain that number, if it does, just generate another.
I would like to add another suggestion. If I understood correctly, you have a pot with 49 numbers and you want to randomly select 6. When you select the 1st there are 48 left from which you want to select 5.
So I don't think it is 100% right to select again a random number from 1 to 49 and if it like the one already selected, to generate another. Because you want after the 1st selection the remaining 48 numbers to have the same possibility to be selected.
So here is my suggestion:
Have a Vector with 49 numbers and always generate a random number from 0 to Vector.size(49). Once generated, remove that number from the Vector and generate again another random number from 0 to Vector.size(48).
The number generated will be actually the index of the element in the Vector, so after a few loops they won't match (The number at index 3 will not be the number '3') but that is not important because the index and the selection will be random so you don't care how the numbers are sorted in the Vector.
Another way is to use an array of 49 numbers and when one of them is selected, "swap" it with the last element and randomly take a number from the first 48:
…