5. As shown in Figure $1, P$ is a point on the graph of the function $y=\frac{1}{2 x}(x>0)$, the line $y=-x+1$ intersects the $x$-axis and $y$-axis at points $A$ and $B$, respectively. Draw $P M \perp x$-axis at point $M$, intersecting $A B$ at point $E$, and draw $P N \perp y$-axis at point $N$, intersecting $A B$ at point $F$. Then the value of $A F \cdot B E$ is (
(A) 2
(B) $\sqrt{2}$
(C) 1
(D) $\frac{1}{2}$
5.C.

Let $P(x, y)$.
From $F N / / O A$, we get $\frac{A F}{A B}=\frac{O N}{O B}$, which means $A F=\sqrt{2} y$.
Similarly, $B E=\sqrt{2} x$.
Therefore, $A F \cdot B E=2 x y=1$.