sakatakintoki さんが書きました:ユーザー名を入力してボタンを押すとその人のスキンがダウンロードできちゃうツール
sakatakintoki さんが書きました:マイクラスキンを変更できちゃうツール
拾い物、使えるかは知らない
tetoranatti さんが書きました:膨大な量のID書き換えがめんどくさかったため、ID書き換えツールを作らさせて頂きました。
private void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
button2.Enabled = false;
textBox1.Enabled = false;
url = "http://s3.amazonaws.com/MinecraftSkins/" + textBox1.Text + ".png";
id = textBox1.Text;
Thread thread = new Thread(new ThreadStart(GetBitmap));
thread.IsBackground = true;
thread.Start();
while (thread.IsAlive)
{
Application.DoEvents();
}
if (bmp == null)
{
MessageBox.Show("スキンのダウンロードに失敗しました。", "失敗", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (pictureBox1.Image != null) pictureBox1.Dispose();
button2.Enabled = false;
}
else
{
button2.Enabled = false;
pictureBox1.Image = bmp;
button2.Enabled = true;
}
button1.Enabled = true;
textBox1.Enabled = true;
}
public void GetBitmap()
{
try
{
WebClient cl = new WebClient();
byte[] pic = cl.DownloadData(url);
MemoryStream st = new MemoryStream(pic);
bmp = new Bitmap(st);
st.Close();
return;
}
catch
{
bmp = null;
return;
}
}
private void button2_Click(object sender, EventArgs e)
{
sfd.FileName = id+".png";
sfd.InitialDirectory = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);
sfd.Filter =
"PNGファイル(*.png)|*.png|すべてのファイル(*.*)|*.*";
sfd.FilterIndex = 1;
sfd.Title = "保存先のファイル";
sfd.RestoreDirectory = true;
sfd.OverwritePrompt = true;
sfd.CheckPathExists = true;
if (sfd.ShowDialog() == DialogResult.OK)
{
bmp.Save(sfd.FileName);
}
}