티스토리 뷰



Check_title.exe





내용 정리는 나중에...



우선 코드만 아래에




///// Fomr1



public Form1 ( )

        {

            InitializeComponent ( );



            dataGridView1.ColumnCount = 2;



            dataGridView1.Columns [ 0 ].Name = "가수";

            dataGridView1.Columns [ 1 ].Name = "노래";



            comboBox1.Items.Add ( " - " );

            comboBox1.Items.Add ( "-" );

            comboBox1.Items.Add ( " ㅡ " );

            comboBox1.Items.Add ( "ㅡ" );



            comboBox1.SelectedIndex = 0 ;

        }


        private void button1_Click ( object sender, EventArgs e )

        {

            OpenFileDialog OFD = new OpenFileDialog();

            OFD.ShowDialog();



            if ( OFD != null )

            {

                StreamReader SR = new StreamReader( OFD.FileName );


                string sLine = "";

                string[] sResult = { "", "" };

                string sSpliter = "";

                while ( true )

                {

                    sLine = SR.ReadLine ( );

                    if ( sLine == null )

                    {

                        break;

                    }



                    // to do

                    for ( int n = 0; n < comboBox1.Items.Count; n++ )

                    {

                        if ( sLine.Contains ( comboBox1.Items [ n ].ToString ( ) ) )

                        {

                            if ( sLine.Contains ( "가입" ) || sLine.Contains ( "추천:" ) )

                            { 

                                continue;

                            }



                            sSpliter = comboBox1.Items [ n ].ToString ( ).Trim();

                            sResult = sLine.Split( sSpliter[0] );

                            dataGridView1.Rows.Add ( sResult[0], sResult[1] );

                            break;

                        }

                    }

                }

            }

        }



        private void button2_Click ( object sender, EventArgs e )

        {

            if ( dataGridView1.Rows.Count < 0 )

            { 

                MessageBox.Show("Input부터");

                return;

            }



            StreamWriter SW = new StreamWriter( @"C:\Result.txt" );

            for ( int n = 0; n < dataGridView1.Rows.Count; n++ )

            { 

                SW.Write( dataGridView1.Rows[n].Cells[0].Value + " - " + dataGridView1.Rows[n].Cells[1].Value + "\r\n");

            }

            SW.Close();

        }



        private void button3_Click ( object sender, EventArgs e )

        {

            if ( dataGridView1.CurrentCellAddress.Y < 0 )

            {

                MessageBox.Show ( "Input부터" );

                return;

            }



            Form2 F2 = new Form2( dataGridView1.Rows[ dataGridView1.CurrentCellAddress.Y ].Cells[0].Value.ToString().Trim(),

                                  dataGridView1.Rows[ dataGridView1.CurrentCellAddress.Y ].Cells[1].Value.ToString().Trim() );

            F2.Show();

        }






///////////////////////////Form2


        public Form2 ( string sTemp1, string sTemp2 )

        {

            InitializeComponent ( );



            Uri address = new Uri ( "http://www.google.co.kr/search?q=" + sTemp1 + "+" + sTemp2 

                                    + "&oq=" + sTemp1 + "+" + sTemp2 + "&aqs=chrome..69i57.302j0j1&sourceid=chrome&ie=UTF-8" );

            webBrowser1.Url = address;

        }

댓글
댓글쓰기 폼