- Timestamp:
- 2016-05-14 14:52:44 (7 years ago)
- Location:
- 2015/24/EemeliK
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
2015/24/EemeliK/Cmd/Cmd/Cmd.csproj
r7154 r7169 55 55 <Compile Include="Program.cs" /> 56 56 <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> 57 63 <EmbeddedResource Include="Form1.resx"> 58 64 <DependentUpon>Form1.cs</DependentUpon> -
2015/24/EemeliK/Cmd/Cmd/Form1.Designer.cs
r7154 r7169 34 34 this.timer1 = new System.Windows.Forms.Timer(this.components); 35 35 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); 36 38 this.SuspendLayout(); 37 39 // … … 47 49 this.label1.Text = "Microsoft Windows [Version 6.1.7601]\r\nCopyright (c) 2009 Microsoft Corporation. " + 48 50 "All rights reserved.\r\n\r\nC:\\Users\\eemeli.kotro>"; 51 this.label1.Click += new System.EventHandler(this.label1_Click); 49 52 // 50 53 // timer1 … … 64 67 this.label2.Click += new System.EventHandler(this.label2_Click); 65 68 // 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 // 66 83 // Form1 67 84 // … … 70 87 this.BackColor = System.Drawing.SystemColors.ActiveCaptionText; 71 88 this.ClientSize = new System.Drawing.Size(656, 333); 89 this.Controls.Add(this.label4); 72 90 this.Controls.Add(this.label2); 73 91 this.Controls.Add(this.label1); … … 75 93 this.Name = "Form1"; 76 94 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); 77 98 this.ResumeLayout(false); 78 99 this.PerformLayout(); … … 85 106 private System.Windows.Forms.Timer timer1; 86 107 private System.Windows.Forms.Label label2; 108 private System.Windows.Forms.Label label4; 109 private System.Windows.Forms.Timer timer2; 87 110 } 88 111 } -
2015/24/EemeliK/Cmd/Cmd/Form1.cs
r7154 r7169 10 10 using System.Threading.Tasks; 11 11 using System.Windows.Forms; 12 using System.Net; 12 13 13 14 namespace Cmd … … 15 16 public partial class Form1 : Form 16 17 { 18 WebClient webClient; 19 17 20 public Form1() 18 21 { … … 44 47 label2.Font = new Font(pfc.Families[0], label2.Font.Size); 45 48 49 label4.Font = new Font(pfc.Families[0], label4.Font.Size); 50 46 51 //// free up the unsafe memory 47 52 //Marshal.FreeCoTaskMem(data); … … 62 67 else 63 68 { 69 PaivitaSijainti(); 64 70 label2.Visible = true; 65 71 LabelJuttu--; 66 72 } 67 73 } 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 } 68 178 } 69 179 } -
2015/24/EemeliK/Cmd/Cmd/Form1.resx
r7154 r7169 120 120 <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 121 <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> 122 125 </metadata> 123 126 <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.