Dynamic Property and Magnetic Nonpotentiality of Two Types of Confined Solar Flares