MyEpisodes Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MyEpisode C#+PHP software with aquired/seen support.

 
Post new topic   Reply to topic    MyEpisodes Forum Index -> Developers
View previous topic :: View next topic  
Author Message
aciidb0mb3r


Posts: 5

PostPosted: Mon Mar 07, 2011 5:07 pm    Post subject: MyEpisode C#+PHP software with aquired/seen support. Reply with quote

Hi,
I guess screenshot will explain it all.


Its made in C#.
PHP is used for retrieving information.
Features:
1. Gets Info from AIO.
2. Autoupdates after a User-Defined interval.
3. Saves Username, Password and Update Interval.
4. Minimized to Tray.
5. You can Update Aquired/Seen From Within the software.

Tested/Made in visual studio C# Express 2010.

Exe[For Non Developers] -> http://ankit.im/MyEpisodes.exe

Source:
PHP files -> http://ankit.im/myepisodes.rar
I am a beginner at C# so code might seem a bit messy :/
C# Files -> http://ankit.im/MyEpisodesCsharp.rar

I wanted to put in a Progressbar also but i am not able to .__. [due to lack of time and C# knowledge].
Feedbacks appreciated Smile
Back to top
View user's profile Send private message
ocdcsv


Posts: 12

PostPosted: Sat Jun 11, 2011 1:09 pm    Post subject: Reply with quote

Nice work getting it working.

Some comments.
No Scroll Bar so can't access shows that are outside the screen window.
Can't Resize the window either.

I get huge gaps between shows not as group as your screenshot.

Some future thoughts.
The ability to scan a directory of TV shows and mark acquired from what it finds in each tv show etc.
Back to top
View user's profile Send private message
bjuraga


Posts: 1

PostPosted: Sun Sep 25, 2011 7:09 pm    Post subject: Reply with quote

little tweak on your code
Code:

using System;
using System.Windows.Forms;
using System.Net;


namespace MyEpisodes
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            textBox1.Text = Properties.Settings.Default.username;
            textBox2.Text = Properties.Settings.Default.password;
            textBox3.Text = Properties.Settings.Default.interval;
            button1.Text = "Login";
        }
        string[] split;
        int nextTop = 10;
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
            button1.Text = "Refresh";
            panel1.Controls.Clear();
            Properties.Settings.Default.username = textBox1.Text;
            Properties.Settings.Default.password = textBox2.Text;

            Properties.Settings.Default.Save();
            textBox1.Enabled = false;
            textBox2.Enabled = false;
            WebClient client = new WebClient();
            string downloadString = client.DownloadString("http://ankit.im/myepisodes/index.php?user=" + textBox1.Text + "&pass=" + textBox2.Text);
            //string downloadString = client.DownloadString("http://localhost/myepisodes/");
            split = downloadString.Split(new Char[] { '\n' });
            label1.Text = split[0];
            int len = split.Length - 1;
            nextTop = 0;
            for (int i = 1; i < len; i++)
            {
                string[] finalvals = split[i].Replace("<br />", "").Split(new Char[] { ';' });
                if (finalvals.Length == 6)
                {
                    filldetails(finalvals, i);
                    nextTop += 30;
                }
                if (finalvals.Length == 5)
                {
                    addlinklabel(finalvals[0], i, 9, 126, finalvals[1].Substring(0, 3));
                    addlabel(finalvals[2], i, 150, 50);
                    addlabel(finalvals[1], i, 200, 130);
                    addlabel(finalvals[3], i, 330, 130);
                    addlabel(finalvals[4], i, 460, 70);
                    nextTop += 30;
                }
            }


        }
        void filldetails(string[] finalvals, int i)
        {
            addlinklabel(finalvals[0], i, 9, 126, finalvals[1].Substring(0, 3));
            addlabel(finalvals[2], i, 150, 50);
            addlabel(finalvals[1], i, 200, 130);
            addlabel(finalvals[3], i, 330, 130);
            addlabel(finalvals[4], i, 460, 70);
            string[] links = finalvals[5].Split(new Char[] { ':' });
            if (links.Length == 1)
            {
                addbutton(i, finalvals[5], 550, "Seen");

            }
            if (links.Length == 2)
            {
                addbutton(i, links[0], 550, "Aquired");
                addbutton(i, links[1], 650, "Seen");
            }
        }

        void addbutton(int i, string tag, int left, string name)
        {
            Button dynamicButton = new Button();
            dynamicButton.Name = "dynamicButton" + i.ToString();
            dynamicButton.Width = 75;
            dynamicButton.Height = 22;
            dynamicButton.Left = left;
            dynamicButton.Top = nextTop;
            dynamicButton.Text = name;
            dynamicButton.Tag = tag;
            dynamicButton.Click += new EventHandler(Button_Click); //hook the Click event
            panel1.Controls.Add(dynamicButton);
        }

        private void Button_Click(object sender, EventArgs e)
        {
            Button clickedButton = (Button)sender; //get the button that was clicked
            WebClient client = new WebClient();
            string downloadString = client.DownloadString("http://ankit.im/myepisodes/req.php?user=" + textBox1.Text + "&pass=" + textBox2.Text + "&link=" + clickedButton.Tag.ToString());
            button1.PerformClick();


        }

        void addlabel(string text, int i, int left, int width)
        {
            Label dynamicTextbox = new Label();
            dynamicTextbox.Name = "dynamicTextbox";
            //dynamicTextbox.AutoSize = true;
            dynamicTextbox.Width = width;
            dynamicTextbox.Height = 15;
            dynamicTextbox.Left = left;
            dynamicTextbox.Top = nextTop + 3;
            dynamicTextbox.Text = text;
            panel1.Controls.Add(dynamicTextbox);
        }
        void addlinklabel(string text, int i, int left, int width, string tag)
        {
            LinkLabel dynamicTextbox = new LinkLabel();
            dynamicTextbox.Name = "dynamicTextbox";
            dynamicTextbox.Width = width;
            dynamicTextbox.Height = 15;
            dynamicTextbox.Left = left;
            dynamicTextbox.Tag = tag;
            dynamicTextbox.Top = nextTop + 3;
            dynamicTextbox.Click += new EventHandler(Link_Click);
            dynamicTextbox.Text = text;
            panel1.Controls.Add(dynamicTextbox);
        }
        private void Link_Click(object sender, EventArgs e)
        {
            LinkLabel label = (LinkLabel)sender;

            System.Diagnostics.Process.Start("http://www.google.co.in/search?q=" + label.Text + " " + label.Tag);
        }
        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Enabled = true;
            textBox2.Enabled = true;
            label1.Text = "";
            panel1.Controls.Clear();
            button1.Text = "Login";
        }

        private void frmMain_Resize(object sender, EventArgs e)
        {
            if (FormWindowState.Minimized == this.WindowState)
            {
                mynotifyicon.Visible = true;
                mynotifyicon.ShowBalloonTip(500);
                this.Hide();
            }
            else if (FormWindowState.Normal == this.WindowState)
            {
                mynotifyicon.Visible = false;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Hide();

        }

        private void mynotifyicon_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Show();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            button1.PerformClick();
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            timer1.Interval = (Convert.ToInt32(textBox3.Text) * 3600000);
            Properties.Settings.Default.interval = textBox3.Text;
        }

    }
}



Code:


namespace MyEpisodes
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.panel1 = new System.Windows.Forms.Panel();
            this.button1 = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.Cookie = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.User = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.button2 = new System.Windows.Forms.Button();
            this.mynotifyicon = new System.Windows.Forms.NotifyIcon(this.components);
            this.button3 = new System.Windows.Forms.Button();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.textBox3 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            //
            // panel1
            //
            this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.panel1.AutoScroll = true;
            this.panel1.Controls.Add(this.label1);
            this.panel1.Location = new System.Drawing.Point(0, 58);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(734, 404);
            this.panel1.TabIndex = 0;
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.Location = new System.Drawing.Point(385, 11);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 2;
            this.button1.Text = "Refresh";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // label1
            //
            this.label1.AutoEllipsis = true;
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(52, -16);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(31, 13);
            this.label1.TabIndex = 3;
            this.label1.Text = "        ";
            //
            // Cookie
            //
            this.Cookie.AutoSize = true;
            this.Cookie.Location = new System.Drawing.Point(3, 42);
            this.Cookie.Name = "Cookie";
            this.Cookie.Size = new System.Drawing.Size(43, 13);
            this.Cookie.TabIndex = 4;
            this.Cookie.Text = "Cookie:";
            //
            // textBox1
            //
            this.textBox1.Location = new System.Drawing.Point(69, 12);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(100, 20);
            this.textBox1.TabIndex = 5;
            //
            // textBox2
            //
            this.textBox2.Location = new System.Drawing.Point(258, 12);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(100, 20);
            this.textBox2.TabIndex = 5;
            this.textBox2.UseSystemPasswordChar = true;
            //
            // User
            //
            this.User.AutoSize = true;
            this.User.Location = new System.Drawing.Point(12, 15);
            this.User.Name = "User";
            this.User.Size = new System.Drawing.Size(55, 13);
            this.User.TabIndex = 4;
            this.User.Text = "Username";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(188, 15);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(53, 13);
            this.label3.TabIndex = 4;
            this.label3.Text = "Password";
            //
            // button2
            //
            this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button2.Location = new System.Drawing.Point(474, 11);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 6;
            this.button2.Text = "Logout";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            //
            // mynotifyicon
            //
            this.mynotifyicon.Icon = ((System.Drawing.Icon)(resources.GetObject("mynotifyicon.Icon")));
            this.mynotifyicon.Text = "notifyIcon1";
            this.mynotifyicon.Visible = true;
            this.mynotifyicon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.mynotifyicon_MouseDoubleClick);
            //
            // button3
            //
            this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button3.Location = new System.Drawing.Point(560, 11);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(75, 23);
            this.button3.TabIndex = 7;
            this.button3.Text = "Tray";
            this.button3.UseVisualStyleBackColor = true;
            this.button3.Click += new System.EventHandler(this.button3_Click);
            //
            // timer1
            //
            this.timer1.Interval = 3600000;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            //
            // textBox3
            //
            this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.textBox3.Location = new System.Drawing.Point(643, 30);
            this.textBox3.Name = "textBox3";
            this.textBox3.Size = new System.Drawing.Size(40, 20);
            this.textBox3.TabIndex = 8;
            this.textBox3.TextChanged += new System.EventHandler(this.textBox3_TextChanged);
            //
            // label2
            //
            this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(640, 9);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(82, 13);
            this.label2.TabIndex = 9;
            this.label2.Text = "Refresh Interval";
            //
            // label4
            //
            this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(687, 33);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(35, 13);
            this.label4.TabIndex = 9;
            this.label4.Text = "Hours";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(734, 462);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.textBox3);
            this.Controls.Add(this.button3);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.textBox2);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.User);
            this.Controls.Add(this.Cookie);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.panel1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MinimumSize = new System.Drawing.Size(750, 500);
            this.Name = "Form1";
            this.Text = "MyEpisodes Manager";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label Cookie;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.Label User;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.NotifyIcon mynotifyicon;
        private System.Windows.Forms.Button button3;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.TextBox textBox3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label4;
    }
}

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    MyEpisodes Forum Index -> Developers All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Main design by MW. Refitted to board by Hostile.