özkan533
Centipat
- Katılım
- 21 Temmuz 2024
- Mesajlar
- 285
- Çözümler
- 1
Daha fazla
- Cinsiyet
- Erkek
Selamünaleyküm C# da Minecraft Launcher yapmak istedim ama error veriyor konuya cevap yazan herkese teşekkür ederim, bu arada nugetden cmllib'i yükledim hata yaptıysam çok özür dilerim.
Error bu.
Kod:
Error bu.
Kod:
C#:
Using System;
Using System. Collections. Generic;
Using System.componentmodel;
Using System. Data;
Using System. Drawing;
Using System. Linq;
Using System. Text;
Using System. Threading. Tasks;
Using System. Windows. Forms;
Using cmllib. Core;
Using cmllib. Core. Auth;
Using System. Threading;
Using static System. Windows. Forms. Visualstyles. Visualstyleelement;
Namespace bonzi_launcher.
{
Public partial class form1: Form.
{
Public Form1()
{
InitializeComponent();
Control. Checkforıllegalcrossthreadcalls = false;
}
Public static string versiyon;
Private Void path()
{
Var path = New MinecraftPath();
Var Launcher = New cmlauncher(path);
Foreach (var item in launcher.GetAllVersions())
{
Combobox1.ıtems. Add(item. Name);
}
}
Private Void Launch()
{
Var path = New MinecraftPath();
Var Launcher = New cmlauncher(path);
#Pragma warning disable CS0618 // tür veya üye artık kullanılmıyor.
Var launchoption = New mlaunchoption.
{
Maximumrammb = 3044,
Session = msession. Getofflinesession(textbox1.text),
Serverıp = "",
};
#Pragma warning restore CS0618 // tür veya üye artık kullanılmıyor.
Versiyon = comboBox1.SelectedItem.ToString();
Var process = Launcher. Createprocess(versiyon, launchoption);
process.Start();
Hide();
}
Private Void form1_load(object sender, eventargs e)
{
path();
}
Private Void button1_click(object sender, eventargs e)
{
Button1.enabled = false;
Thread thread = New thread(() => Launch());
thread.Start();
}
Private class cmlauncher.
{
Private minecraftpath path;
Public cmlauncher(minecraftpath path)
{
This. Path = path;
}
}
}
}