MainForm.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace JuicyLauncher
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
try
{
//读取版本
listBox1.Items.Clear();
String[] vers = Directory.GetDirectories(Application.StartupPath + "\\.minecraft\\versions");
foreach (String item0 in vers)
{
listBox1.Items.Add(item0.Replace(Application.StartupPath + "\\.minecraft\\versions\\",""));
}
}
catch (Exception)
{
throw;
}
}
private void button2_Click(object sender, EventArgs e)
{
Settings s = new Settings();
s.LoadForm();
s.Show();
}
private void button1_Click(object sender, EventArgs e)
{
//启动
String[] TCfg=new String[3];
TCfg=System.IO.File.ReadAllLines(Application.StartupPath + "\\JLConfig.JLConfig");//读取配置
Launcher launcher = new Launcher();
if (listBox1.SelectedIndex == -1)
{
listBox1.SelectedIndex = 0;
}
launcher.Launch(TCfg[0], TCfg[1], TCfg[2], listBox1.SelectedItem.ToString());
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace JuicyLauncher
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
try
{
//读取版本
listBox1.Items.Clear();
String[] vers = Directory.GetDirectories(Application.StartupPath + "\\.minecraft\\versions");
foreach (String item0 in vers)
{
listBox1.Items.Add(item0.Replace(Application.StartupPath + "\\.minecraft\\versions\\",""));
}
}
catch (Exception)
{
throw;
}
}
private void button2_Click(object sender, EventArgs e)
{
Settings s = new Settings();
s.LoadForm();
s.Show();
}
private void button1_Click(object sender, EventArgs e)
{
//启动
String[] TCfg=new String[3];
TCfg=System.IO.File.ReadAllLines(Application.StartupPath + "\\JLConfig.JLConfig");//读取配置
Launcher launcher = new Launcher();
if (listBox1.SelectedIndex == -1)
{
listBox1.SelectedIndex = 0;
}
launcher.Launch(TCfg[0], TCfg[1], TCfg[2], listBox1.SelectedItem.ToString());
}
}
}











