The phenomenon of band splitting in type II bursts can be a unique diagnostic for the magnetic field in the corona, which is, however, inevitably sensitive to the ambient density. We apply this diagnostic to the CME-flare event on 2004 August 18, for which we are able to locate the propagation of the type II burst and determine the ambient coronal electron density by other means. We measure the width of the band splitting on a dynamic spectrum of the bursts observed with the Green Bank Solar Radio Burst Spectrometer (GBSRBS), and convert it to the Alfven Mach number under the Rankine-Hugoniot relation. We then determine the Alfven speed and magnetic field strength using the coronal background density and shock speed measured with the MLSO/MK4 coronameter. In this way we find that the shock compression ratio is in the range of 1.5-1.6, the Alfvenic Mach number is 1.4-1.5, the Alfven speed is 550-400 kms(-1), and finally the magnetic field strength decreases from 1.3 to 0.4 G while the shock passes from 1.6 to 2.1 R-circle dot. The magnetic field strength derived from the type II spectrum is finally compared with the potential field source surface ( PFSS) model for further evaluation of this diagnostic.