private void btnSaveFile_Click(object sender, EventArgs e)
        {
            uint ret = NBioAPI.Error.NONE;

            string szFileName = "";

            DirectoryInfo Dir = new DirectoryInfo(@"C:\Users\MC114\Desktop\iteva.ISDB");

            szFileName = Dir.FullName;

            if (szFileName != "")
            {
                if (File.Exists(@"C:\Users\MC114\Desktop\iteva.ISDB"))
                {
                    try
                    {
                        File.Delete(@"C:\Users\MC114\Desktop\iteva.ISDB");
                        File.Delete(@"C:\Users\MC114\Desktop\iteva.FID");
                    }
                    catch (IOException ex)
                    {
                        MessageBox.Show(ex.Message);
                        return;
                    }
                }
                // Save SearchDB to File
                ret = m_IndexSearch.SaveDBToFile(szFileName);
                if (ret != NBioAPI.Error.NONE)
                {
                    DisplayErrorMsg(ret);
                    return;
                }

                // Save list to file
                szFileName = Path.ChangeExtension(szFileName, "FID");

                FileStream   fs = new FileStream(szFileName, FileMode.OpenOrCreate, FileAccess.Write);
                StreamWriter fw = new StreamWriter(fs);

                for (int i = 0; i < listSearchDB.Items.Count; i++)
                {
                    fw.WriteLine(listSearchDB.Items[i].Text + "\t" + listSearchDB.Items[i].SubItems[2].Text + "\t" +
                                 listSearchDB.Items[i].SubItems[1].Text);
                }

                fw.Close();
                fs.Close();
            }
        }
        private void btnSaveFile_Click(object sender, System.EventArgs e)
        {
            uint ret = NBioAPI.Error.NONE;

            SaveFileDialog saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();

            string szFileName = "";

            saveFileDialog1.Filter = "ISDB files (*.ISDB)|*.ISDB";

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

            szFileName = saveFileDialog1.FileName;
            if (szFileName != "")
            {
                // Save SearchDB to File
                ret = m_IndexSearch.SaveDBToFile(szFileName);
                if (ret != NBioAPI.Error.NONE)
                {
                    DisplayErrorMsg(ret);
                    return;
                }

                // Save list to file
                szFileName = Path.ChangeExtension(szFileName, "FID");

                FileStream   fs = new FileStream(szFileName, FileMode.OpenOrCreate, FileAccess.Write);
                StreamWriter fw = new StreamWriter(fs);

                for (int i = 0; i < listSearchDB.Items.Count; i++)
                {
                    fw.WriteLine(listSearchDB.Items[i].Text + "\t" + listSearchDB.Items[i].SubItems[1].Text + "\t" + listSearchDB.Items[i].SubItems[2].Text);
                }

                fw.Close();
                fs.Close();

                MessageBox.Show("Save SearchDB to file success!");
            }
            else
            {
                MessageBox.Show("You must enter filename !", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }