Skip to content

Commit

Permalink
commit updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 committed Feb 6, 2021
1 parent 723b980 commit 46b3bfd
Show file tree
Hide file tree
Showing 17 changed files with 511 additions and 72 deletions.
10 changes: 10 additions & 0 deletions Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="res" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resource\res.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="store" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\store.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ You can download paid, restricted and free Apps.

You should download packages of your system and install them all.

Some codes are from the Internet.

Example:![image](doc/example.gif)

### Features
Expand Down
3 changes: 3 additions & 0 deletions Windows Store Downloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
<Compile Include="code\Language.cs" />
<Compile Include="code\Post.cs" />
<Compile Include="code\Program.cs" />
<Compile Include="code\ShapeButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="code\global.cs" />
<Compile Include="code\zh-CN.cs" />
Expand Down
31 changes: 30 additions & 1 deletion code/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 97 additions & 27 deletions code/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Drawing.Drawing2D;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;

namespace Windows_Store_Downloader
{
public partial class Form1 : Form
{


public Form1()
{
InitializeComponent();

}

private bool textBoxHasText = false;
Expand Down Expand Up @@ -68,6 +71,7 @@ private string SetAttributeText() {
return Language.lang_attributes[typeBox.SelectedIndex];
}


private void DownloadButton_Click(object sender, EventArgs e)
{
downloadButton.Enabled = false;
Expand All @@ -81,8 +85,8 @@ private void DownloadButton_Click(object sender, EventArgs e)
{
if (langText.Text == "")
{
langText.Text = System.Threading.Thread.CurrentThread.CurrentCulture.Name;
}
langText.Text = Thread.CurrentThread.CurrentCulture.Name;
}//提交语言
postContent = "type=" + Http_Post.type[typeBox.SelectedIndex] + "&url=" + attributeText.Text + "&ring=" +
Http_Post.ring[routeBox.SelectedIndex] + "&lang=" + langText.Text;

Expand All @@ -97,15 +101,36 @@ private void DownloadButton_Click(object sender, EventArgs e)
Thread.Sleep(random.Next(67, 101));
progressBar1.PerformStep();
}
}
}//伪装进度条
progressBar1.Value = 100;
downloadButton.Enabled = true;
if (Form2.returnid == -1)
{
MessageBox.Show(Language.lang_interr, Language.lang_interr, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}//意外
new Form2().ShowDialog();
if (Form2.returnid == 1)
{
try
{




}
catch (InvalidComObjectException) { }
catch (Exception ex)
{
Language.InternalErrMsgBox(ex);
}
}

}

}

private void ChangeLanguage(object sender, EventArgs e)
private void ChangeLanguage(object sender, EventArgs e)//更改语言
{
if (langBox.Text == "English")
{
Expand All @@ -117,19 +142,9 @@ private void ChangeLanguage(object sender, EventArgs e)

private void Form1_Load(object sender, EventArgs e)
{


User32.AnimateWindow(this.Handle, 1000, User32.AW_BLEND | User32.AW_ACTIVE | User32.AW_VER_NEGATIVE);

Bitmap a = Properties.Resources.store;
a.MakeTransparent(Color.FromArgb(0, 255, 0));
pictureBox1.BackgroundImage = a;
if (System.Diagnostics.Debugger.IsAttached != true)
{
langText.Visible = false;
langPackText.Visible = false;
}


RefreshForm();
WriteToTemp.ReadFrom();
if (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "zh-CN") {
Chinese_Lang();
Expand All @@ -138,12 +153,13 @@ private void Form1_Load(object sender, EventArgs e)
English_Lang();
langBox.SelectedIndex = 0;
}
typeBox.SelectedIndex = 0;
routeBox.SelectedIndex = 2;

}

User32.AnimateWindow(this.Handle, 200, User32.AW_BLEND | User32.AW_ACTIVE | User32.AW_VER_NEGATIVE);
RefreshForm();
this.Opacity = 0.9;


}

private void Chinese_Lang()
{
Expand All @@ -164,9 +180,9 @@ private void SetLang() {
groupBox1.Text = Language.lang_downbutton;
attributeText.Text = Language.lang_input;
progressText.Text = Language.lang_prog;
}
}//设置语言文本

private void RefreshText(object sender, EventArgs e)
private void RefreshText(object sender, EventArgs e)//刷新文本
{
HasText();
if (textBoxHasText == false)
Expand All @@ -181,10 +197,63 @@ private void RefreshText(object sender, EventArgs e)
}
}

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
private void Form1_FormClosed(object sender, FormClosedEventArgs e)//淡出
{
User32.AnimateWindow(this.Handle, 1000, User32.AW_BLEND | User32.AW_HIDE);
this.Opacity = 1;
User32.AnimateWindow(this.Handle, 300, User32.AW_BLEND | User32.AW_HIDE);
}
private void RefreshForm()//初始化窗口
{
Bitmap a = Properties.Resources.store;
a.MakeTransparent(Color.FromArgb(0, 255, 0));//透明图片
pictureBox1.BackgroundImage = a;
if (System.Diagnostics.Debugger.IsAttached != true)
{
langText.Visible = false;
langPackText.Visible = false;
debugWebsite.Visible = false;
debugWebBrowser.Visible = false;
}//调试内容
typeBox.SelectedIndex = 0;
routeBox.SelectedIndex = 2;
//初始化选择框

attributeText.Text = SetAttributeText();
attributeText.ForeColor = Color.Gray;
textBoxHasText = false;
//初始化文字

}


private void Form1_Paint(object sender, PaintEventArgs e)
{



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); //实例化刷子,第一个参数指示上色区域,第二个和第三个参数分别渐变颜色的开始和结束,第四个参数表示颜色的方向。
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)
{
Debug.WriteLine(Form2.webBrowser1.Url);
}

}
class User32
{
Expand All @@ -208,5 +277,6 @@ class User32
public const int AW_ACTIVE = 0x20000;//激活窗口,在使用了AW_HIDE标志后不要使用这个标志
public const int AW_SLIDE = 0x40000;//使用滑动类型动画效果,默认为滚动动画类型,当使用AW_CENTER标志时,这个标志就被忽略
public const int AW_BLEND = 0x80000;//使用淡入淡出效果
}
}//淡入淡出

}
5 changes: 3 additions & 2 deletions code/Form2.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 46b3bfd

Please sign in to comment.