本研究的第一部份針對鈦、304不銹鋼、碳鋼、銅、鎳、鋁、鎂於1- ethyl-3-methylimidazolium chloride aluminum chloride(EMIC-AlCl3)、1- ethyl-3-methylimidazolium chloride dicyanamide (EMI-DCA)、N-methyl-N-alkylpyrrolidinium dicyanamide (BMP-DCA)中的腐蝕行為進行探討,並比較不同陰陽離子對於材料於離子液體中的腐蝕行為之影響。研究結果顯示,不同陰離子對於材料於離子液體中的腐蝕行為影響較大。材料於相同陰離子的EMI-DCA與BMP-DCA中展現了相似的腐蝕行為。此外大多數材料於EMIC-AlCl3中的腐蝕電流較於EMI-DCA與BMP-DCA中大,故EMIC-AlCl3對材料的侵蝕性較EMI-DCA與BMP-DCA強。本研究的第二部份也使用離子液體作為溶劑分別溶入數種金屬鹽,將鎂金屬浸泡於溶液中,於鎂金屬表面進行置換反應以提高鎂金屬的抗腐蝕能力。結果顯示藉由離子液體成功地將銅、鎳、鋅置換於鎂金屬表面。由吸收光譜結果可觀察到溶液中的金屬離子逐漸轉變為金屬,而將表面沖洗後分析結果也與純金屬相近,故實驗中藉由置換反應將純金屬置換於鎂金屬表面。置換反應完成後之鎂金屬於0.1 M Na2SO4中進行的動態電位極化曲線結果也指出,置換反應後腐蝕電位獲得改善。陽極區也產生鈍化現象,其中又以置換銅、鎳的抗腐蝕能力提升較為顯著。In part one of this study, the corrosion behaviors of seven materials(titanium, 304 stainless steel, carbon steel, copper, nickel, aluminum, magnesium ) in three different ionic liquids including 1- ethyl-3-methylimidazolium chloride aluminum chloride(EMIC-AlCl3), 1- ethyl-3-methylimidazolium chloride dicyanamide (EMI-DCA), and N-methyl-N-alkylpyrrolidinium dicyanamide (BMP-DCA) have been investigated to know the effect of different cation and anion. The results indicate that the corrosion behaviors of these materials are similar in ionic liquids (EMI-DCA, BMP-DCA) with the same anion. Furthermore, most of materials have higher corrosion current in EMIC-AlCl3 than in EMI-DCA or BMP-DCA.This investigation uses ionic liquid with many kind metallic ions to make replacement with magnesium. Replacing metal on Mg surface helps improving corrosion resistance. The results show copper, nickel, zinc could be reduced on magnesium surface by replacement reaction. In X-ray Absorption Spectroscopy, the energy peaks shifted toward lower photo energy during replacement processes by transformation from metal ions to pure metal. After cleaning the sample surface, the analytical results of the sample surface are similar with the results of pure metals. Potentiodynamic polarization results indicate that the corrosion resistance of Mg samples has been improved after replacing treatment. The results show extraordinary passivation when replace copper and nickel on magnesium surface.