单项选择题

______ the building did he realize that there was danger everywhere in it.

A. Upon entering
B. When he entered
C. Only after entering
D. After he had entered