SaveFileDialog使用方法

           

       SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "txt files(*.txt)|*.txt|xls files(*.xls)|*.xls|All files(*.*)|*.*"; //过滤

            sfd.DefaultExt = "txt"; //默认扩展名

            DialogResult dr = sfd.ShowDialog();



            if (dr == DialogResult.OK)

            {

               //your code

            }

你可能感兴趣的:(dialog)