Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Commit

Permalink
Complete bomber studio
Browse files Browse the repository at this point in the history
  • Loading branch information
ZYFDroid committed Aug 18, 2019
1 parent d59d34c commit f5cd4f5
Show file tree
Hide file tree
Showing 9 changed files with 788 additions and 307 deletions.
10 changes: 10 additions & 0 deletions BomberStudio/BomberStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
<Compile Include="FrmBuildBomber.Designer.cs">
<DependentUpon>FrmBuildBomber.cs</DependentUpon>
</Compile>
<Compile Include="FrmDisplayText.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmDisplayText.Designer.cs">
<DependentUpon>FrmDisplayText.cs</DependentUpon>
</Compile>
<Compile Include="FrmTextEscape.cs">
<SubType>Form</SubType>
</Compile>
Expand All @@ -78,6 +84,9 @@
<EmbeddedResource Include="FrmBuildBomber.resx">
<DependentUpon>FrmBuildBomber.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmDisplayText.resx">
<DependentUpon>FrmDisplayText.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmTextEscape.resx">
<DependentUpon>FrmTextEscape.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -118,6 +127,7 @@
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
611 changes: 306 additions & 305 deletions BomberStudio/Form1.Designer.cs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions BomberStudio/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,10 @@ private void BtnTestSend_Click(object sender, EventArgs e)
btnTestSend.Enabled = false;
testSendWorker.RunWorkerAsync(machine);
}

private void ToolStripMenuItem1_Click(object sender, EventArgs e)
{
new FrmBuildBomber(txtCode.Text).ShowDialog();
}
}
}
112 changes: 111 additions & 1 deletion BomberStudio/FrmBuildBomber.Designer.cs

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

126 changes: 125 additions & 1 deletion BomberStudio/FrmBuildBomber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -12,9 +14,131 @@ namespace BomberStudio
{
public partial class FrmBuildBomber : Form
{
public FrmBuildBomber()
string script = "";
public FrmBuildBomber(string script)
{
InitializeComponent();
this.script = script;
}

private void FrmBuildBomber_Load(object sender, EventArgs e)
{
cmbType.SelectedIndex = 0;
}

private void ValThreadCount_Scroll(object sender, EventArgs e)
{

}

private void NumericUpDown1_ValueChanged(object sender, EventArgs e)
{

int i = decimal.ToInt32(numThreadCount.Value);
if (i < 16)
{
lblComment.Text = i + "线程,小火慢炖。";
}
else if (i < 50)
{
lblComment.Text = i + "线程,非常适合轰炸。";
}
else if (i < 72)
{
lblComment.Text = i + "线程,大力轰炸。";
}
else if (i < 128)
{
lblComment.Text = i + "线程,电脑可能吃不消。";
}
else if (i < 256)
{
lblComment.Text = i + "线程,需要非常高配的电脑。";
}
else if (i <= 1024)
{
lblComment.Text = i + "线程,运营商可能会把电话打到你家里去。";

This comment has been minimized.

Copy link
@Dobby233Liu

Dobby233Liu Aug 18, 2019

wtf

}
}

private void Button1_Click(object sender, EventArgs e)
{
if (chkUseRGB.Checked) {
script="#开启RGB\r\n" + script;
}

script = "#线程数 "+numThreadCount.Value+"\r\n" + script;

if (cmbType.SelectedIndex == 0) {
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) {
string root = folderBrowserDialog1.SelectedPath;
root = Path.Combine(root, "轰炸机");
CopyDirectory("template\\windows", root, true);
File.WriteAllText(Path.Combine(root, "script.hbs"), script);
Process.Start("explorer", "\""+root+"\"");
Close();
}
}

if (cmbType.SelectedIndex == 1)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
string root = folderBrowserDialog1.SelectedPath;
root = Path.Combine(root, "轰炸机");
CopyDirectory("template\\linux", root, true);
File.WriteAllText(Path.Combine(root, "script.hbs"), script);
Process.Start("explorer", "\"" + root + "\"");
Close();
}
}

if (cmbType.SelectedIndex == 2)
{
script = "#复制这段内容,粘贴到安卓轰炸机里,即可开始轰炸\r\n" + script;
new FrmDisplayText(script).Show();
Close();
}

}




private static bool CopyDirectory(string SourcePath, string DestinationPath, bool overwriteexisting)
{
bool ret = false;
try
{
SourcePath = SourcePath.EndsWith(@"\") ? SourcePath : SourcePath + @"\";
DestinationPath = DestinationPath.EndsWith(@"\") ? DestinationPath : DestinationPath + @"\";

if (Directory.Exists(SourcePath))
{
if (Directory.Exists(DestinationPath) == false)
Directory.CreateDirectory(DestinationPath);

foreach (string fls in Directory.GetFiles(SourcePath))
{
FileInfo flinfo = new FileInfo(fls);
flinfo.CopyTo(DestinationPath + flinfo.Name, overwriteexisting);
}
foreach (string drs in Directory.GetDirectories(SourcePath))
{
DirectoryInfo drinfo = new DirectoryInfo(drs);
if (CopyDirectory(drs, DestinationPath + drinfo.Name, overwriteexisting) == false)
ret = false;
}
}
ret = true;
}
catch (Exception ex)
{
ret = false;
}
return ret;
}


}
}
3 changes: 3 additions & 0 deletions BomberStudio/FrmBuildBomber.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
Loading

1 comment on commit f5cd4f5

@Dobby233Liu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoa

Please sign in to comment.