Two I-containing compounds, (C6H8N3)+I3-(1, C6H7N3=2,3-dihydroimidazo[1,2-a]pyrimidine-1-ium) and [(Cu3I4)(C8H17N2)](2, C8H17N2=N-ethyl-1,4-diazabicyclo[2.2.2]octane), were synthesized under solvothermal conditions based on in situ ligand reaction and characterized via elemental analysis, XRD and single crystal X-ray diffraction analysis. Complex 1 crystallizes in the triclinic system, space group P1 with a=0.74281(15) nm, b=0.84241(17) nm, c=0.9993(2) nm, α=82.02(3)°, β=83.30(3)°, γ=82.92(3)°, V=0.6114(2) nm3. Complex 2 crystallizes in the monoclinic system, space group P21/c with a=0.68924(14) nm, b=1.0786(2) nm, c=2.2779(5) nm, β=94.84(3)°, V=1.6874(6) nm3. Two kinds of in situ ligand reaction were found in the synthesis of these complexes. (C6H8N3)+ ligand was synthesized from 2-aminopyrimidine and ethanol in complex 1, whereas(C8H17N2)+ ligand was synthesized from 1,4-diazabicyclo[2.2.2]octane and ethanol in complex 2.