示例#1
0
        private void moves_Load(object sender, EventArgs e)
        {
            //if movie available offline replace download with watch now
            new Thread(() => {
                //fill in ads

                try
                {
                    var request = WebRequest.Create("http://erchatt.webs.com/movies2.jpg");

                    using (var response = request.GetResponse())
                        using (var stream = response.GetResponseStream())
                        {
                            moviepic.Image = Bitmap.FromStream(stream);
                        }
                }
                catch
                {
                    moviepic.ImageLocation = "data\\adbuff";
                    moviepic.Show();
                }
            }).Start();
            new Thread(() =>
            {
                try
                {
                    search.Visible = false;
                    TempFile t     = new TempFile();

                    string conncode1    = string.Format(@"URI = file:{0}\\media-movies-links.db", scrip_location);
                    SQLiteConnection cn = new SQLiteConnection(conncode1);
                    cn.Open();

                    SQLiteCommand cmd   = new SQLiteCommand(cn);
                    cmd.CommandText     = "select * from movie_links";
                    SQLiteDataReader dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        string addrs = (string)dr["link"];

                        try
                        {
                            WebClient wb = new WebClient();
                            string s     = wb.DownloadString(addrs);

                            foreach (string i in LinkFinder.Find(s))
                            {
                                string webaddrs = string.Format("{0}/{1}", addrs, i);

                                TempFile tmp = new TempFile(i, webaddrs);
                                movielist.Items.Add(i);
                            }
                            wb.Dispose();
                        }
                        catch
                        {
                            continue;
                        }
                    }
                    cn.Close();
                }
                catch (Exception ex) { MessageBox.Show(ex.ToString()); }
                search.Visible = true;
            }).Start();
        }
示例#2
0
        private void genrelist_SelectedIndexChanged(object sender, EventArgs e)
        {
            movielist.Items.Clear();

            new Thread(() => {
                try
                {
                    /**
                     * string Gen = genrelist.Text;
                     * string mvigenre = string.Format("cache_data\\movie_data\\{0}.png", Gen);
                     * genrepic.ImageLocation = mvigenre;
                     * genrepic.Show();
                     *
                     * btndownload.Text = "Download Movies";
                     * moviepic.Visible = false;
                     * moviename.Text = "Movie  Name";
                     * moviesize.Text = "Size in GB";
                     *
                     * mvies.Open();
                     * SQLiteCommand cmd = new SQLiteCommand(mvies);
                     *
                     * string ctext = string.Format("select * from movies where genre = '{0}'", Gen);
                     * cmd.CommandText = ctext;
                     *
                     * SQLiteDataReader mvreader = cmd.ExecuteReader();
                     * while (mvreader.Read())
                     * {
                     *  string mvname = (string)mvreader["name"];
                     *  Movie mv = new Movie(mvname);
                     *  movielist.Items.Add(mv.movie_name);
                     *
                     * }
                     * mvies.Close();
                     *
                     **/


                    SQLiteConnection cn = new SQLiteConnection(conncode);
                    cn.Open();

                    SQLiteCommand cmd   = new SQLiteCommand(cn);
                    cmd.CommandText     = string.Format("select * from movie_links where genre = '{0}'", genrelist.SelectedItem);
                    SQLiteDataReader dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        string addrs1 = (string)dr["link"];

                        try
                        {
                            WebClient wb = new WebClient();
                            string s     = wb.DownloadString(addrs1);

                            foreach (string i in LinkFinder.Find(s))
                            {
                                string webaddrs = string.Format("{0}/{1}", addrs1, i);

                                TempFile tmp = new TempFile(i, webaddrs);
                                movielist.Items.Add(i);
                            }
                            wb.Dispose();
                        }
                        catch
                        {
                            continue;
                        }
                    }
                }
                catch (Exception ex) { MessageBox.Show(ex.Message); }
            }).Start();
        }