|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Windows; |
| 6 | +using System.Windows.Controls; |
| 7 | +using System.Windows.Data; |
| 8 | +using System.Windows.Documents; |
| 9 | +using System.Windows.Input; |
| 10 | +using System.Windows.Media; |
| 11 | +using System.Windows.Media.Imaging; |
| 12 | +using System.Windows.Navigation; |
| 13 | +using System.Windows.Shapes; |
| 14 | + |
| 15 | +namespace wannacry |
| 16 | +{ |
| 17 | + /// <summary> |
| 18 | + /// MainWindow.xaml 的交互逻辑 |
| 19 | + /// </summary> |
| 20 | + public partial class MainWindow : Window |
| 21 | + { |
| 22 | + System.Windows.Threading.DispatcherTimer disTimer; |
| 23 | + System.Windows.Threading.DispatcherTimer disTimer2; |
| 24 | + string cn_title1 = "我的电脑出了什么问题?"; |
| 25 | + string cn_title2 = "有没有恢复这些文档的方法?"; |
| 26 | + string cn_para1 = "您的一些重要文件被我加密保存了。\n照片、图片、文档、压缩包、音频、视频文件、exe文件等,几乎所有类型的文件都被加密了,因此不能正常打开。\n这和一般文件损坏有本质上的区别,您大可在网上找找恢复文件的方法,我敢保证,没有我们的解密服务,就算老天爷来了也不能恢复这些文档。\n"; |
| 27 | + string cn_para2 = "当然有可恢复的方法。只能通过我们的解密服务才能恢复。我以人格担保,能提供安全有效的恢复服务。\n但这是收费的,也不能无限期的推迟。\n请点击<Decrypt>按钮,就可以免费恢复一些文档。请您放心,我是绝不会骗你的。\n但想要恢复全部文档,需要付款点费用。\n是否随时都可以固定金额付款,就会恢复的吗,当然不是,推迟付款时间越长对你不利。\n最好3天之内付款费用,过了三天费用就会翻倍。\n还有,一个礼拜之内未付款,将会永远恢复不了。\n对了,忘了告诉你,对半年以上没钱付款的穷人,会有活动免费恢复,能否轮到你,就要看您运气怎么样了。\n"; |
| 28 | + string en_title1 = "What Happened to My Computer?"; |
| 29 | + string en_title2 = "Can I Recover My Files?"; |
| 30 | + string en_title3 = "How Do I Pay?"; |
| 31 | + string en_para1 = "Your important files are encrypted.\nMany of your documents, photos, videos, databases and other files are no longer accessible because they have been encrypted. Maybe you are busy looking for a way to recover your files, but do not waste your time. Nobody can recover your files without our decryption service.\n"; |
| 32 | + string en_para2 = "Sure. We guarantee that you can recover all your files safely and easily. But you have not so enough time.\nYou can decrypt some of your files for free. Try now by clicking .\nBut if you want to decrypt all your files, you need to pay.\nYou only have 3 days to submit the payment. After that the price will be doubled.\nAlso, if you don’t pay in 7 days, you won’t be able to recover your files forever.\nWe will have free events for users who are so poor that they couldn’t pay in 6 months.\n"; |
| 33 | + string en_para3 = "Payment is accepted in Bitcoin only. For more information, click .\nPlease check the current price of Bitcoin and buy some bitcoins. For more information, click .\nAnd send the correct amount to the address specified in this window.\nAfter your payment, click . Best time to check: 9:00am – 11:00am GMT from Monday to Friday.\nOnce the payment is checked, you can start decrypting your files immediately.\nContact\nIf you need our assistance, send a message by clicking contact Us.\nWe strongly recommend you to not remove this software, and disable your anti-virus for a while, until you pay and the payment gets processed. If your anti-virus gets updated and removes this software automatically, it will not be able to recover your files even if you pay!"; |
| 34 | + int day = 3; |
| 35 | + int hour = 0; |
| 36 | + int minute = 0; |
| 37 | + int second = 0; |
| 38 | + int day2 = 6; |
| 39 | + int hour2 = 0; |
| 40 | + int minute2 = 0; |
| 41 | + int second2 = 0; |
| 42 | + |
| 43 | + public MainWindow() |
| 44 | + { |
| 45 | + InitializeComponent(); |
| 46 | + comboBox.Items.Add("Chinese (Simplified)"); |
| 47 | + comboBox.Items.Add("English"); |
| 48 | + comboBox.SelectedIndex = 0; |
| 49 | + |
| 50 | + disTimer = new System.Windows.Threading.DispatcherTimer(); |
| 51 | + disTimer.Interval = new TimeSpan(0, 0, 0, 1); //参数分别为:天,小时,分,秒。此方法有重载,可根据实际情况调用。 |
| 52 | + disTimer.Tick += new EventHandler(count_time); //每一秒执行的方法 |
| 53 | + disTimer.Start(); |
| 54 | + |
| 55 | + disTimer2 = new System.Windows.Threading.DispatcherTimer(); |
| 56 | + disTimer2.Interval = new TimeSpan(0, 0, 0, 1); //参数分别为:天,小时,分,秒。此方法有重载,可根据实际情况调用。 |
| 57 | + disTimer2.Tick += new EventHandler(count_time2); //每一秒执行的方法 |
| 58 | + disTimer2.Start(); |
| 59 | + } |
| 60 | + |
| 61 | + private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) |
| 62 | + { |
| 63 | + richTextBox.Document.Blocks.Clear(); |
| 64 | + if (comboBox.SelectedIndex == 0) |
| 65 | + initChinese(); |
| 66 | + else |
| 67 | + initEnglish(); |
| 68 | + } |
| 69 | + |
| 70 | + void count_time(object sender, EventArgs e) |
| 71 | + { |
| 72 | + second--; |
| 73 | + if (second < 0) { |
| 74 | + second = 59; |
| 75 | + minute--; |
| 76 | + if (minute < 0) { |
| 77 | + minute = 59; |
| 78 | + hour--; |
| 79 | + if (hour < 0) { |
| 80 | + hour = 23; |
| 81 | + day--; |
| 82 | + if (day < 0) { |
| 83 | + //倒计时结束 |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | + string time = String.Format("{0:D2}:{1:D2}:{2:D2}:{3:D2}", day, hour, minute, second); |
| 89 | + label_time1.Content = time; |
| 90 | + } |
| 91 | + |
| 92 | + void count_time2(object sender, EventArgs e) |
| 93 | + { |
| 94 | + second2--; |
| 95 | + if (second2 < 0) { |
| 96 | + second2 = 59; |
| 97 | + minute2--; |
| 98 | + if (minute2 < 0) { |
| 99 | + minute2 = 59; |
| 100 | + hour2--; |
| 101 | + if (hour2 < 0) { |
| 102 | + hour2 = 23; |
| 103 | + day2--; |
| 104 | + if (day2 < 0) { |
| 105 | + //倒计时结束 |
| 106 | + } |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + string time = String.Format("{0:D2}:{1:D2}:{2:D2}:{3:D2}", day2, hour2, minute2, second2); |
| 111 | + label_time2.Content = time; |
| 112 | + } |
| 113 | + |
| 114 | + private void initChinese() { |
| 115 | + richTextBox.Document.Blocks.Clear(); |
| 116 | + var t1 = new Paragraph(); |
| 117 | + var tt1 = new Run(cn_title1); |
| 118 | + t1.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 119 | + t1.Inlines.Add(tt1); |
| 120 | + t1.FontSize = 17; |
| 121 | + t1.FontWeight = FontWeights.Bold; |
| 122 | + richTextBox.Document.Blocks.Add(t1); |
| 123 | + |
| 124 | + var p1 = new Paragraph(); |
| 125 | + var pp1 = new Run(cn_para1); |
| 126 | + p1.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 127 | + p1.Inlines.Add(pp1); |
| 128 | + p1.FontSize = 13; |
| 129 | + p1.FontWeight = FontWeights.Normal; |
| 130 | + richTextBox.Document.Blocks.Add(p1); |
| 131 | + |
| 132 | + var t2 = new Paragraph(); |
| 133 | + var tt2 = new Run(cn_title2); |
| 134 | + t2.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 135 | + t2.Inlines.Add(tt2); |
| 136 | + t2.FontSize = 17; |
| 137 | + t2.FontWeight = FontWeights.Bold; |
| 138 | + richTextBox.Document.Blocks.Add(t2); |
| 139 | + |
| 140 | + var p2 = new Paragraph(); |
| 141 | + var pp2 = new Run(cn_para2); |
| 142 | + p2.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 143 | + p2.Inlines.Add(pp2); |
| 144 | + p2.FontSize = 13; |
| 145 | + p2.FontWeight = FontWeights.Normal; |
| 146 | + richTextBox.Document.Blocks.Add(p2); |
| 147 | + } |
| 148 | + private void initEnglish() |
| 149 | + { |
| 150 | + richTextBox.Document.Blocks.Clear(); |
| 151 | + var t1 = new Paragraph(); |
| 152 | + var tt1 = new Run(en_title1); |
| 153 | + t1.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 154 | + t1.Inlines.Add(tt1); |
| 155 | + t1.FontSize = 17; |
| 156 | + t1.FontWeight = FontWeights.Bold; |
| 157 | + richTextBox.Document.Blocks.Add(t1); |
| 158 | + |
| 159 | + var p1 = new Paragraph(); |
| 160 | + var pp1 = new Run(en_para1); |
| 161 | + p1.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 162 | + p1.Inlines.Add(pp1); |
| 163 | + p1.FontSize = 13; |
| 164 | + p1.FontWeight = FontWeights.Normal; |
| 165 | + richTextBox.Document.Blocks.Add(p1); |
| 166 | + |
| 167 | + var t2 = new Paragraph(); |
| 168 | + var tt2 = new Run(en_title2); |
| 169 | + t2.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 170 | + t2.Inlines.Add(tt2); |
| 171 | + t2.FontSize = 17; |
| 172 | + t2.FontWeight = FontWeights.Bold; |
| 173 | + richTextBox.Document.Blocks.Add(t2); |
| 174 | + |
| 175 | + var p2 = new Paragraph(); |
| 176 | + var pp2 = new Run(en_para2); |
| 177 | + p2.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 178 | + p2.Inlines.Add(pp2); |
| 179 | + p2.FontSize = 13; |
| 180 | + p2.FontWeight = FontWeights.Normal; |
| 181 | + richTextBox.Document.Blocks.Add(p2); |
| 182 | + |
| 183 | + var t3 = new Paragraph(); |
| 184 | + var tt3 = new Run(en_title3); |
| 185 | + t3.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 186 | + t3.Inlines.Add(tt3); |
| 187 | + t3.FontSize = 17; |
| 188 | + t3.FontWeight = FontWeights.Bold; |
| 189 | + richTextBox.Document.Blocks.Add(t3); |
| 190 | + |
| 191 | + var p3 = new Paragraph(); |
| 192 | + var pp3 = new Run(en_para3); |
| 193 | + p3.SetValue(Paragraph.LineHeightProperty, 3.0); |
| 194 | + p3.Inlines.Add(pp3); |
| 195 | + p3.FontSize = 13; |
| 196 | + p3.FontWeight = FontWeights.Normal; |
| 197 | + richTextBox.Document.Blocks.Add(p3); |
| 198 | + } |
| 199 | + |
| 200 | + |
| 201 | + private void button_check_Click(object sender, RoutedEventArgs e) |
| 202 | + { |
| 203 | + MessageBox.Show("不给钱就加密", "付钱", MessageBoxButton.OK, MessageBoxImage.Information); |
| 204 | + } |
| 205 | + |
| 206 | + private void button_decrypt_Click(object sender, RoutedEventArgs e) |
| 207 | + { |
| 208 | + MessageBox.Show("给钱才能解密", "解密", MessageBoxButton.OK, MessageBoxImage.Information); |
| 209 | + } |
| 210 | + |
| 211 | + private void Hyperlink_Click(object sender, RoutedEventArgs e) |
| 212 | + { |
| 213 | + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(label_contact.NavigateUri.ToString())); |
| 214 | + } |
| 215 | + |
| 216 | + private void button_copy_Click(object sender, RoutedEventArgs e) |
| 217 | + { |
| 218 | + MessageBox.Show("代码自己写吧", "复制", MessageBoxButton.OK, MessageBoxImage.Information); |
| 219 | + } |
| 220 | + |
| 221 | + } |
| 222 | +} |
0 commit comments