Ejemplo n.º 1
0
        sourceFileButton_Click(object sender, System.EventArgs e)
        {
            // Show Open File dialog

            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "MP3 (*.mp3)|*.mp3|WAV (*.wav)|" +
                              "*.wav|All Files (*.*)|*.*";

            openFile.FileName        = "";
            openFile.CheckFileExists = true;
            openFile.CheckPathExists = true;


            if (openFile.ShowDialog() != DialogResult.OK)
            {
                return;
            }


            // Set input file formation

            try
            {
                inputFileFormat =
                    audioConverter.CheckSoundFormat(openFile.FileName);
            }
            catch (Exception ex)
            {
                ShowExceptionMsg(ex);
                return;
            }

            sourceFileLabel.Text = inputFile = openFile.FileName;
        }
Ejemplo n.º 2
0
        /*
         * 选择转换源文件
         */
        protected void sourceFileButton_Click(object sender, EventArgs e)
        {
            // 打开文件选择窗口
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "MP3 (*.mp3)|*.mp3|" +
                              "WAV (*.wav)|*.wav";
            openFile.FileName = "";

            openFile.CheckFileExists = true;
            openFile.CheckPathExists = true;

            if (openFile.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            // 设置输入文件格式
            try
            {
                inputFileFormat = audioConverter.CheckSoundFormat(openFile.FileName);
            }
            catch (Exception ex)
            {
                ShowExceptionMsg(ex);
                return;
            }

            sourceFileLabel.Text = inputFile = openFile.FileName;
        }