  ALICE is the dedicated heavy-ion experiment at the LHC. Its main physics goal
is to study the properties of strongly-interacting matter at conditions of high
energy density (>10 GeV/ fm^3) and high temperature (> 0.5 GeV) expected to be
reached in central Pb-Pb collisions. Charm and beauty quarks are powerful tools
to investigate this high density and strongly interacting state of matter since
they are produced in initial hard scatterings that are therefore generated
early in the system evolution and probe its hottest, densest stage. The
measurement of the charm production cross sections in pp collisions provides an
interesting insight into QCD processes and is crucial as a reference for heavy
ion studies. We present open charm cross section measurements in pp collisions
at \sqrt{s} = 7 TeV and \sqrt{s}=2.76 TeV in the central rapidity region. In
addition, the first measurement of nuclear modification factor of D-meson in
Pb-Pb collisions at \sqrt{s}= 2.76 TeV is shown.
