  Heavy quarks are a unique probe to study the medium produced in
ultra-relativistic heavy ion collisions. The dominant process of charm quark
production at RHIC is believed to be initial gluon fusion which can be
calculated in the perturbative QCD. The upper limit of FONLL calculation seems
to be in good agreement with charm cross section measurements at mid-rapidity
in $p+p$ collisions at $\sqrt{s_{NN}}$ = 200 GeV provided by STAR. The same
measurement in Au+Au collisions at equal energy reveals the
number-of-binary-collisions scaling of charm cross section indicating that
charm production is dominated by initial hard scatterings. In this article, we
report the measurements of $D^{0}$, $D^{*}$ in $p+p$ at 0.6 GeV/$c < p_T < 6$
GeV/$c$ and $D^0$ in Au+Au collisions at 0.2 GeV/$c < p_T < 5$ GeV/$c$ via
hadronic decays $D^{0}\rightarrow K^-\pi^+,\ D^{*+}\rightarrow
D^0\pi^+\rightarrow K^-\pi^+\pi^+$ at mid-rapidity $|y|<1$. {abstract}
