Abstract:The paper presents the theory and algorithm of the developing and applying frequecy-resolued optical gating (FROG) method for retrieving the amplitude and phase of an ultrashort laser pulse.For frequency-doubling configuration (SHG-FROG),we program the computer to retrieve to the amplitude and phase of the pulse,and it is the program that no one ever published up to now.We give the retrieved results got by the program and our development of the trditional algorithm.The algorithm was tested to be robust and handy for diagnosing ultrashort pulses with varying characteristics.