diff --git a/Readme.md b/Readme.md index ace2c04..e61358c 100644 --- a/Readme.md +++ b/Readme.md @@ -13,7 +13,7 @@ You should download packages of your system and install them all. Some codes are from the Internet. -Example:![image](doc/example.gif) +Example:![image](doc/example.webp) ### Features * Download Microsoft Store Apps diff --git a/code/Form1.Designer.cs b/code/Form1.Designer.cs index 8bb51ca..00ce38d 100644 --- a/code/Form1.Designer.cs +++ b/code/Form1.Designer.cs @@ -44,8 +44,6 @@ private void InitializeComponent() this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.progressText = new System.Windows.Forms.Label(); - this.debugWebBrowser = new System.Windows.Forms.Button(); - this.debugWebsite = new System.Windows.Forms.TextBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -211,31 +209,11 @@ private void InitializeComponent() this.progressText.TabIndex = 12; this.progressText.Text = "Query Progress"; // - // debugWebBrowser - // - this.debugWebBrowser.Location = new System.Drawing.Point(17, 406); - this.debugWebBrowser.Name = "debugWebBrowser"; - this.debugWebBrowser.Size = new System.Drawing.Size(171, 90); - this.debugWebBrowser.TabIndex = 13; - this.debugWebBrowser.Text = "WebBrowser"; - this.debugWebBrowser.UseVisualStyleBackColor = true; - this.debugWebBrowser.Click += new System.EventHandler(this.debugWebBrowser_Click); - // - // debugWebsite - // - this.debugWebsite.Location = new System.Drawing.Point(223, 407); - this.debugWebsite.Name = "debugWebsite"; - this.debugWebsite.Size = new System.Drawing.Size(532, 29); - this.debugWebsite.TabIndex = 14; - this.debugWebsite.Text = "https://www.example.com"; - // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1109, 749); - this.Controls.Add(this.debugWebsite); - this.Controls.Add(this.debugWebBrowser); + this.ClientSize = new System.Drawing.Size(1109, 625); this.Controls.Add(this.pictureBox1); this.Controls.Add(this.progressText); this.Controls.Add(this.progressBar1); @@ -278,8 +256,6 @@ private void InitializeComponent() private System.Windows.Forms.ProgressBar progressBar1; private System.Windows.Forms.Label progressText; private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Button debugWebBrowser; - private System.Windows.Forms.TextBox debugWebsite; } } diff --git a/code/Form1.cs b/code/Form1.cs index 11dcafe..b236a13 100644 --- a/code/Form1.cs +++ b/code/Form1.cs @@ -77,9 +77,11 @@ private void DownloadButton_Click(object sender, EventArgs e) downloadButton.Enabled = false;//禁止重复点击 Form2.complete = false; progressBar1.Value = 0; - if (typeBox.SelectedIndex == -1 || routeBox.SelectedIndex == -1 || attributeText.Text == "") + HasText(); + if (typeBox.SelectedIndex == -1 || routeBox.SelectedIndex == -1 || textBoxHasText == false) { MessageBox.Show(Language.lang_baddown,Language.lang_baddowninfo,MessageBoxButtons.OK,MessageBoxIcon.Error); + downloadButton.Enabled = true; return; }//参数完整 @@ -110,7 +112,9 @@ private void DownloadButton_Click(object sender, EventArgs e) MessageBox.Show(Language.lang_interr, Language.lang_interr, MessageBoxButtons.OK, MessageBoxIcon.Error); return; }//意外 - + if (Form2.returnid == 2) { + Form2.ShowDialog(); + }//空响应 if (Form2.returnid == 1)//浏览 { try @@ -120,7 +124,7 @@ private void DownloadButton_Click(object sender, EventArgs e) { Language.InternalErrMsgBox(ex); } - } + }//OK @@ -207,8 +211,6 @@ private void RefreshForm()//初始化窗口 { langText.Visible = false; langPackText.Visible = false; - debugWebsite.Visible = false; - debugWebBrowser.Visible = false; }//调试内容 typeBox.SelectedIndex = 0; routeBox.SelectedIndex = 2; @@ -221,29 +223,31 @@ private void RefreshForm()//初始化窗口 } - + private Rectangle rect; + private bool firstPaint = true; private void Form1_Paint(object sender, PaintEventArgs e) { - + //防止画窗口出错 + if(firstPaint == true) + { + firstPaint = false; + rect = this.ClientRectangle; + } Graphics g = e.Graphics; //实例化Graphics 对象g Color FColor = Color.FromArgb(0xE8, 0xF1, 0xE7); //颜色1 Color TColor = Color.FromArgb(0xCA, 0xC7, 0xC7); //颜色2 - Brush b = new LinearGradientBrush(this.ClientRectangle, FColor, TColor, LinearGradientMode.BackwardDiagonal); //实例化刷子,第一个参数指示上色区域,第二个和第三个参数分别渐变颜色的开始和结束,第四个参数表示颜色的方向。 + Brush b = new LinearGradientBrush(rect, FColor, TColor, LinearGradientMode.BackwardDiagonal); //实例化刷子,第一个参数指示上色区域,第二个和第三个参数分别渐变颜色的开始和结束,第四个参数表示颜色的方向。 g.FillRectangle(b, this.ClientRectangle); //进行上色 - + } - private void debugWebBrowser_Click(object sender, EventArgs e) - { - new Form2().Show(); - //Form2.webBrowser1.Navigate(debugWebsite.Text); - - } + + private void button1_Click(object sender, EventArgs e) { diff --git a/code/Form2.Designer.cs b/code/Form2.Designer.cs index b8b8e00..dc7da62 100644 --- a/code/Form2.Designer.cs +++ b/code/Form2.Designer.cs @@ -42,7 +42,6 @@ private void InitializeComponent() this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 23); this.webBrowser1.Name = "webBrowser1"; this.webBrowser1.ScriptErrorsSuppressed = true; - this.webBrowser1.ScrollBarsEnabled = false; this.webBrowser1.Size = new System.Drawing.Size(1256, 750); this.webBrowser1.TabIndex = 0; this.webBrowser1.Url = new System.Uri("", System.UriKind.Relative); diff --git a/code/Form2.cs b/code/Form2.cs index ee24a8a..95c9a0f 100644 --- a/code/Form2.cs +++ b/code/Form2.cs @@ -69,12 +69,12 @@ public void Browse() string result3 = Mdui(result2); Debug.WriteLine(result3); string result4; - if(Language.langUsing == "global")//language + if(Language.langUsing == "global") { result4 = Properties.Resources.table_1 + "\n" + result3 + "\n" + Properties.Resources.table_2; } else { result4 = Properties.Resources.table_1_cn + "\n" + result3 + "\n" + Properties.Resources.table_2_cn; - } + } //language File.WriteAllText(WriteToTemp.tmpPath + @"\" + Language.lang_tablehtm,result4);//写出合并后的文本 @@ -100,28 +100,45 @@ private string RemoveUselessContent(string old)//格式化 } private string Mdui(string old)//加入Mdui格式 { - string new1; + string new1,new2; new1 = old.Replace("class=\"tftable\" border=\"1\" align=\"center\"", "class=\"mdui-table\" style=\"margin-left: 20px;margin-right: 20px;margin-top: 20px;\"") .Replace("style=\"width:180px;\"", "") .Replace("style=\"width:300px;\"", "") .Replace("style=\"width:60px;\"", "") .Replace("style=\"background-color:rgba(255, 255, 255, 0.8)\"", "") - .Replace("style=\"background-color:rgba(188, 235, 240, 0.8)\"", "class=\"mdui-color-blue-100\""); - return new1; + .Replace("style=\"background-color:rgba(188, 235, 240, 0.8)\"", "class=\"mdui-color-blue-100\"") + .Replace("1970-01-01 00:00:00 GMT","Unlimited"); + if (Language.langUsing != "global") + { + new2 = new1.Replace("File:", "文件:") + .Replace("Expire:","过期时间:"). + Replace("SHA-1:","SHA-1校验值:") + .Replace("Size:","文件大小:"); + } else { new2 = new1; } + + return new2; } private void Form2_Load(object sender, EventArgs e) { - //打开网页 var urlString = new Uri(WriteToTemp.tmpPath + @"\" + Language.lang_tablehtm); Debug.WriteLine(urlString); if (System.Diagnostics.Debugger.IsAttached == true) { webBrowser1.AllowWebBrowserDrop = true; } + if (returnid != 2) + { + webBrowser1.Navigate(urlString); + } + else + { + webBrowser1.Navigate(WriteToTemp.tmpPath + "\\" + Language.lang_errhtm); + } //打开网页 + + + - webBrowser1.Navigate(urlString); - webBrowser1.DocumentTitleChanged += DocTitleClose; } private void DocTitleClose(object sender, EventArgs e) diff --git a/doc/cn.md b/doc/cn.md index fdfe25d..c1a34e5 100644 --- a/doc/cn.md +++ b/doc/cn.md @@ -13,7 +13,7 @@ 部分代码来自互联网。 -例图:![image](example.gif) +例图:![image](cn.webp) ### Features * 下载微软商店的原因 diff --git a/doc/cn.webp b/doc/cn.webp new file mode 100644 index 0000000..8d850ab Binary files /dev/null and b/doc/cn.webp differ diff --git a/doc/example.gif b/doc/example.gif deleted file mode 100644 index e69de29..0000000 diff --git a/doc/example.webp b/doc/example.webp new file mode 100644 index 0000000..1fbb836 Binary files /dev/null and b/doc/example.webp differ diff --git a/resource/res.zip b/resource/res.zip index 425b8fd..4f4152a 100644 Binary files a/resource/res.zip and b/resource/res.zip differ diff --git a/resource/table/table-1-cn.txt b/resource/table/table-1-cn.txt index 0fea312..663727b 100644 --- a/resource/table/table-1-cn.txt +++ b/resource/table/table-1-cn.txt @@ -20,7 +20,7 @@
- Download link generated! + 链接已生成!
search