C# Kodu hata veriyor

Public static stringe çevirdiğinizde ve çevirmediğinizde aldığınız hataları paylaşır mısınız?

C#:
using CmlLib.Core;
using CmlLib.Core.Auth;
using System;
using System.Threading;
using System.Windows.Forms;
namespace Aeron_Launcher

{ public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 Control.CheckForIllegalCrossThreadCalls = false;
 }

 public int MaximumRamMb { get; private set; }
 public MSession Session { get; private set; }

 private void guna2Button1_Click(object sender, EventArgs e)
 {
 if (String.IsNullOrEmpty(guna2TextBox1.Text))
 {
 MessageBox.Show("You cant enter the game without using name. Please Enter A user name");
 }

 else
 {

 label2.Text = guna2TextBox1.Text;
 label2.Visible = true;
 guna2Button1.Visible = true;

 Thread thread = new Thread(( => gameoyunac);
 thread.IsBackground = true;
 thread.Start();
 }

 async void gameoyunac(MLaunchOption ayar)
 {
 var path = new MinecraftPath();
 var launcher = new CMLauncher(path);
 {
 MaximumRamMb = 5096;
 Session = MSession.GetOfflineSession(label2.Text);
 }
 var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
 process.Start();
 }
 }

 }
}

Allah aşkına bunlar doğru değil mi?
 
C#:
using CmlLib.Core;
using CmlLib.Core.Auth;
using System;
using System.Threading;
using System.Windows.Forms;
namespace Aeron_Launcher

{ public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 Control.CheckForIllegalCrossThreadCalls = false;
 }

 public int MaximumRamMb { get; private set; }
 public MSession Session { get; private set; }

 private void guna2Button1_Click(object sender, EventArgs e)
 {
 if (String.IsNullOrEmpty(guna2TextBox1.Text))
 {
 MessageBox.Show("You cant enter the game without using name. Please Enter A user name");
 }

 else
 {

 label2.Text = guna2TextBox1.Text;
 label2.Visible = true;
 guna2Button1.Visible = true;

 Thread thread = new Thread(( => gameoyunac);
 thread.IsBackground = true;
 thread.Start();
 }

 async void gameoyunac(MLaunchOption ayar)
 {
 var path = new MinecraftPath();
 var launcher = new CMLauncher(path);
 {
 MaximumRamMb = 5096;
 Session = MSession.GetOfflineSession(label2.Text);
 }
 var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
 process.Start();
 }
 }

 }
}

Allah aşkına bunlar doğru değil mi?

Böyle anlayamam ki ben genelde hata panelinden bakarak yol alıyorum.
 
Böyle anlayamam ki ben genelde hata panelinden bakarak yol alıyorum.
1650656938627.png

Atım hocam.
@uykuda.
 

Dosya Ekleri

  • 1650656928163.png
    1650656928163.png
    32,6 KB · Görüntüleme: 18
C#:
using CmlLib.Core;
using CmlLib.Core.Auth;
using System;
using System.Threading;
using System.Windows.Forms;
namespace Aeron_Launcher

{ public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 Control.CheckForIllegalCrossThreadCalls = false;
 }

 public int MaximumRamMb { get; private set; }
 public MSession Session { get; private set; }

 private void guna2Button1_Click(object sender, EventArgs e)
 {
 if (String.IsNullOrEmpty(guna2TextBox1.Text))
 {
 MessageBox.Show("You cant enter the game without using name. Please Enter A user name");
 }

 else
 {

 label2.Text = guna2TextBox1.Text;
 label2.Visible = true;
 guna2Button1.Visible = true;

 Thread thread = new Thread(( => gameoyunac);
 thread.IsBackground = true;
 thread.Start();
 }

 async void gameoyunac(MLaunchOption ayar)
 {
 var path = new MinecraftPath();
 var launcher = new CMLauncher(path);
 {
 MaximumRamMb = 5096;
 Session = MSession.GetOfflineSession(label2.Text);
 }
 var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
 process.Start();
 }
 }

 }
}

Allah aşkına bunlar doğru değil mi?
Kanki Combox içinde bir sürü veri olabilir. Normal bir string'e dönüşmeyebilir. Oraya sayı girmeyi dene. Ya da Combobox temizleterek parametre olarak dursun.
 
C#:
Thread thread = new Thread( >= gameoyunac);

 thread.IsBackground = true;

 thread.Start();

 }

Bu kısım bu şekilde olacak.

C#:
async void gameoyunac(MLaunchOption ayar)
 {
 var path = new MinecraftPath();
 var launcher = new CMLauncher(path);
 {
 MaximumRamMb = 5096;
 Session = MSession.GetOfflineSession(label2.Text);
 }
 var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
 process.Start();
 }
Bunu da butondan yukarı alacaksınız.
 
C#:
Thread thread = new Thread( >= gameoyunac);

 thread.IsBackground = true;

 thread.Start();

 }

Bu kısım bu şekilde olacak.

C#:
async void gameoyunac(MLaunchOption ayar)
 {
 var path = new MinecraftPath();
 var launcher = new CMLauncher(path);
 {
 MaximumRamMb = 5096;
 Session = MSession.GetOfflineSession(label2.Text);
 }
 var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
 process.Start();
 }
Bunu da butondan yukarı alacaksınız.
Bir saniye. Alttaki kodları nereye yazacağım?
@uykuda.
 
Bir saniye. Alttaki kodları nereye yazacağım?
Alttaki kodları bir yere yazmayacaksınız sadece yeri değişecek;


[CODE lang="csharp" title="şöyle"]using CmlLib.Core;
using CmlLib.Core.Auth;
using System;
using System.Threading;
using System.Windows.Forms;
namespace Aeron_Launcher

{ public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
}

public int MaximumRamMb { get; private set; }
public MSession Session { get; private set; }
async void gameoyunac(MLaunchOption ayar)
{
var path = new MinecraftPath();
var launcher = new CMLauncher(path);
{
MaximumRamMb = 5096;
Session = MSession.GetOfflineSession(label2.Text);
}
var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
process.Start();
}
private void guna2Button1_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(guna2TextBox1.Text))
{
MessageBox.Show("You cant enter the game without using name. Please Enter A user name");
}

else
{

label2.Text = guna2TextBox1.Text;
label2.Visible = true;
guna2Button1.Visible = true;

Thread thread = new Thread( >= gameoyunac);
thread.IsBackground = true;
thread.Start();
}
}
}
}[/CODE]
 
Alttaki kodları bir yere yazmayacaksınız sadece yeri değişecek;


[CODE lang="csharp" title="şöyle"]using CmlLib.Core;
using CmlLib.Core.Auth;
using System;
using System.Threading;
using System.Windows.Forms;
namespace Aeron_Launcher

{ public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
}

public int MaximumRamMb { get; private set; }
public MSession Session { get; private set; }
async void gameoyunac(MLaunchOption ayar)
{
var path = new MinecraftPath();
var launcher = new CMLauncher(path);
{
MaximumRamMb = 5096;
Session = MSession.GetOfflineSession(label2.Text);
}
var process = await launcher.CreateProcessAsync(guna2ComboBox1.Text, ayar);
process.Start();
}
private void guna2Button1_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(guna2TextBox1.Text))
{
MessageBox.Show("You cant enter the game without using name. Please Enter A user name");
}

else
{

label2.Text = guna2TextBox1.Text;
label2.Visible = true;
guna2Button1.Visible = true;

Thread thread = new Thread( >= gameoyunac);
thread.IsBackground = true;
thread.Start();
}
}
}
}[/CODE]
Bütün kodları silip bunu mu yapıştırayım?
 

Yeni konular

Geri
Yukarı