Changeset 7169 for 2015/24


Ignore:
Timestamp:
2016-05-14 14:52:44 (7 years ago)
Author:
sieerinn
Message:
 
Location:
2015/24/EemeliK
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • 2015/24/EemeliK/Cmd/Cmd/Cmd.csproj

    r7154 r7169  
    5555    <Compile Include="Program.cs" /> 
    5656    <Compile Include="Properties\AssemblyInfo.cs" /> 
     57    <Compile Include="Stuff.cs"> 
     58      <SubType>Form</SubType> 
     59    </Compile> 
     60    <Compile Include="Stuff.Designer.cs"> 
     61      <DependentUpon>Stuff.cs</DependentUpon> 
     62    </Compile> 
    5763    <EmbeddedResource Include="Form1.resx"> 
    5864      <DependentUpon>Form1.cs</DependentUpon> 
  • 2015/24/EemeliK/Cmd/Cmd/Form1.Designer.cs

    r7154 r7169  
    3434            this.timer1 = new System.Windows.Forms.Timer(this.components); 
    3535            this.label2 = new System.Windows.Forms.Label(); 
     36            this.label4 = new System.Windows.Forms.Label(); 
     37            this.timer2 = new System.Windows.Forms.Timer(this.components); 
    3638            this.SuspendLayout(); 
    3739            //  
     
    4749            this.label1.Text = "Microsoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation.  " + 
    4850    "All rights reserved.\r\n\r\nC:\\Users\\eemeli.kotro>"; 
     51            this.label1.Click += new System.EventHandler(this.label1_Click); 
    4952            //  
    5053            // timer1 
     
    6467            this.label2.Click += new System.EventHandler(this.label2_Click); 
    6568            //  
     69            // label4 
     70            //  
     71            this.label4.AutoSize = true; 
     72            this.label4.ForeColor = System.Drawing.Color.Silver; 
     73            this.label4.Location = new System.Drawing.Point(180, 40); 
     74            this.label4.Name = "label4"; 
     75            this.label4.Size = new System.Drawing.Size(0, 13); 
     76            this.label4.TabIndex = 3; 
     77            //  
     78            // timer2 
     79            //  
     80            this.timer2.Interval = 1000; 
     81            this.timer2.Tick += new System.EventHandler(this.timer2_Tick); 
     82            //  
    6683            // Form1 
    6784            //  
     
    7087            this.BackColor = System.Drawing.SystemColors.ActiveCaptionText; 
    7188            this.ClientSize = new System.Drawing.Size(656, 333); 
     89            this.Controls.Add(this.label4); 
    7290            this.Controls.Add(this.label2); 
    7391            this.Controls.Add(this.label1); 
     
    7593            this.Name = "Form1"; 
    7694            this.Text = "C:\\Windows\\system32\\cmd.exe"; 
     95            this.Load += new System.EventHandler(this.label1_Click); 
     96            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); 
     97            this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form1_KeyPress); 
    7798            this.ResumeLayout(false); 
    7899            this.PerformLayout(); 
     
    85106        private System.Windows.Forms.Timer timer1; 
    86107        private System.Windows.Forms.Label label2; 
     108        private System.Windows.Forms.Label label4; 
     109        private System.Windows.Forms.Timer timer2; 
    87110    } 
    88111} 
  • 2015/24/EemeliK/Cmd/Cmd/Form1.cs

    r7154 r7169  
    1010using System.Threading.Tasks; 
    1111using System.Windows.Forms; 
     12using System.Net; 
    1213 
    1314namespace Cmd 
     
    1516    public partial class Form1 : Form 
    1617    { 
     18        WebClient webClient; 
     19 
    1720        public Form1() 
    1821        { 
     
    4447            label2.Font = new Font(pfc.Families[0], label2.Font.Size); 
    4548 
     49            label4.Font = new Font(pfc.Families[0], label4.Font.Size); 
     50 
    4651            //// free up the unsafe memory 
    4752            //Marshal.FreeCoTaskMem(data); 
     
    6267            else 
    6368            { 
     69                PaivitaSijainti(); 
    6470                label2.Visible = true; 
    6571                LabelJuttu--; 
    6672            } 
    6773        } 
     74 
     75        void PaivitaSijainti() 
     76        { 
     77                label2.Location = new Point(label4.Right - 3, label2.Location.Y); 
     78        } 
     79 
     80        int Hyppelyjuttu = 0; 
     81        private void Form1_KeyPress(object sender, KeyPressEventArgs e) 
     82        { 
     83            if (e.KeyChar == (char)Keys.Enter) 
     84            { 
     85                if(label4.Text == "color a") 
     86                { 
     87                    label1.ForeColor = System.Drawing.Color.Yellow; 
     88                    label2.ForeColor = System.Drawing.Color.Yellow; 
     89                    label4.ForeColor = System.Drawing.Color.Yellow; 
     90                } 
     91                if (label4.Text == "color f") 
     92                { 
     93                    label1.ForeColor = System.Drawing.Color.White; 
     94                    label2.ForeColor = System.Drawing.Color.White; 
     95                    label4.ForeColor = System.Drawing.Color.White; 
     96                } 
     97                if (label4.Text == "download") 
     98                { 
     99                    //https://dl.dropboxusercontent.com/u/61360562/Kuva.jpg 
     100 
     101                    webClient = new WebClient(); 
     102                    webClient.DownloadProgressChanged += delegate (object o, DownloadProgressChangedEventArgs download) 
     103                    { 
     104                        label4.Text = "Progress: " + download.ProgressPercentage + "%"; 
     105                        //label4.Text = "Progress: " + download.ProgressPercentage + "%"; 
     106                    }; 
     107 
     108                    webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed); 
     109                    webClient.DownloadFileAsync(new Uri("https://dl.dropboxusercontent.com/u/61360562/1_9%20Pvp%20arena.zip"), "c:\\MyTemp\\minecraft.zip"); 
     110 
     111                   // webClient.DownloadFile(new Uri("https://dl.dropboxusercontent.com/u/61360562/1_9%20Pvp%20arena.zip"), "c:\\MyTemp\\minecraft.zip"); 
     112                } 
     113                label4.Text = ""; 
     114                PaivitaSijainti(); 
     115            } 
     116            else if (e.KeyChar == (char)Keys.Back) 
     117            { 
     118                if(label4.Text.Length > 0) 
     119                { 
     120                    label4.Text = label4.Text.Remove(label4.Text.Length - 1); 
     121                    PaivitaSijainti(); 
     122                } 
     123            } 
     124            else 
     125            { 
     126                label4.Text = label4.Text + e.KeyChar; 
     127                PaivitaSijainti(); 
     128                Hyppelyjuttu++; 
     129            } 
     130 
     131 
     132        } 
     133        private void Completed(object sender, AsyncCompletedEventArgs e) 
     134        { 
     135            //timer2.Start(); 
     136            Point paikka = label4.Location; 
     137 
     138            /* 
     139            label4 = new Label(); 
     140            label4.Location = paikka; 
     141            label4.Text = "jee"; 
     142            label4.Font = new Font(pfc.Families[0], label4.Font.Size);*/ 
     143 
     144            PrivateFontCollection pfc = new PrivateFontCollection(); 
     145            pfc.AddFontFile("TerminalVector.ttf"); 
     146 
     147            Label temp = new Label(); 
     148            temp.Location = new Point(210, 40); 
     149            temp.Font = new Font(pfc.Families[0], temp.Font.Size); 
     150            temp.Text = "jee"; 
     151            temp.Visible = true; 
     152            temp.ForeColor = System.Drawing.Color.Yellow; 
     153            Controls.Add(temp); 
     154             
     155 
     156            Controls.Remove(label4); 
     157             
     158            //Controls.Remove(label4); 
     159 
     160        } 
     161 
     162        private void label1_Click(object sender, EventArgs e) 
     163        { 
     164 
     165        } 
     166 
     167        private void Form1_KeyDown(object sender, KeyEventArgs e) 
     168        { 
     169 
     170        } 
     171 
     172        private void timer2_Tick(object sender, EventArgs e) 
     173        { 
     174            label4.Text = " "; 
     175            //label4.Text = String.Empty; 
     176            timer2.Stop(); 
     177        } 
    68178    } 
    69179} 
  • 2015/24/EemeliK/Cmd/Cmd/Form1.resx

    r7154 r7169  
    120120  <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
    121121    <value>17, 17</value> 
     122  </metadata> 
     123  <metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 
     124    <value>104, 17</value> 
    122125  </metadata> 
    123126  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
Note: See TracChangeset for help on using the changeset viewer.