Пример #1
0
        private void btn_Documet_Click(object sender, EventArgs e)
        {
            try
            {
                string fileC   = Path.Combine(_AppPath, @"SCode\shell.c");
                string fileXML = Path.Combine(_AppPath, @"BCode\shell.xml");

                using (StreamWriter sw = new StreamWriter(fileXML, false))
                {
                    using (DocumentC doc = new DocumentC(fileC))
                    {
                        while (!doc.EndOfFile)
                        {
                            string elementText = doc.NextElement().Trim();
                            if (elementText != "")
                            {
                                sw.WriteLine(elementText);
                                sw.WriteLine();
                                sw.Flush();
                            }
                        }
                    }
                    sw.Close();
                }
                MessageBox.Show("OK");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
        private void btn_Documet_Click(object sender, EventArgs e)
        {
            try
            {
                string fileC = Path.Combine(_AppPath, @"SCode\shell.c");
                string fileXML = Path.Combine(_AppPath, @"BCode\shell.xml");

                using (StreamWriter sw = new StreamWriter(fileXML, false))
                {
                    using (DocumentC doc = new DocumentC(fileC))
                    {
                        while (!doc.EndOfFile)
                        {
                            string elementText = doc.NextElement().Trim();
                            if (elementText != "")
                            {
                                sw.WriteLine(elementText);
                                sw.WriteLine();
                                sw.Flush();
                            }
                        }
                    }
                    sw.Close();
                }
                MessageBox.Show("OK");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }