The hosts broke the deadlock and subsequently won the game nine minutes in as Foxley capped off a slick passing move with a neat curled effort into the far corner.
As the Bees began clicking into life after a slow start, Dan Sparkes had two chances in as many minutes to level the scoring. The first he flicked straight into the gloves of St Albans goalkeeper Dean Snedker. The following attack saw him played through with the winger poking wide of the mark on this occasion.
St Albans were still in the hunt for another goal as Callum Reynolds deflected Bobson Bawilng’s cross onto the post, either side of wayward efforts from the edge of the area.
Darren Currie’s side looked much improved at the start of the second half as they went in search of an equaliser. Antonis Vasiliou teed up half-time substitute Mo Bettamer but the latter’s strike was parried away to safety by Snedker.
And after a strong Bees penalty claim was waved away, Joey Iaciofano was inches away from tapping home a low cross at the far post for the hosts.
On the 65th minute Sam Merson tried his luck from the edge of the box but the son of the former Arsenal striker saw his shot flash wide of the far post.
Iaciofano came close again 15 minutes from time for St Albans, while at the other end substitute Roy Syla’s header failed to trouble Snedker in the closing stages.